lib: use stdatomic.h for memory barriers

C11 gives us APIs for fencing logic.  Use that instead of a
a long, per-architecture, hand curated list of definitions.
This commit is contained in:
Ray Strode
2016-08-23 16:52:29 -04:00
parent 1c1ef02b3d
commit 1b89cc58cf
5 changed files with 2 additions and 51 deletions

View File

@ -42,6 +42,7 @@
#include <errno.h>
#include <gio/gio.h>
#include <gio/gunixfdlist.h>
#include <stdatomic.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
@ -54,8 +55,6 @@
#include "sp-perf-counter.h"
#include "util.h"
/*
* Number of pages to map for the ring buffer. We map one additional buffer
* at the beginning for header information to communicate with perf.
@ -227,7 +226,7 @@ sp_perf_counter_flush (SpPerfCounter *self,
tail = info->tail;
head = info->map->data_head;
read_barrier ();
atomic_thread_fence (memory_order_acquire);
if (head < tail)
tail = head;