mcs-queue: a few changes
authorBrian Norris <banorris@uci.edu>
Tue, 5 Mar 2013 18:10:22 +0000 (10:10 -0800)
committerBrian Norris <banorris@uci.edu>
Tue, 5 Mar 2013 18:10:22 +0000 (10:10 -0800)
mcs-queue/my_queue.h

index 80e695829d9954b6f4a81860ca26d6c48e75a5d4..3e3f435b43569eb843932f29122907f6be06967d 100644 (file)
@@ -1,3 +1,5 @@
+#include <stdatomic.h>
+
 #define TRUE                           1
 #define FALSE                          0
 
@@ -11,8 +13,8 @@ typedef union pointer {
                volatile unsigned short count;
                volatile unsigned short ptr;
        } sep;
-       volatile unsigned long con;
-}pointer_t;
+       atomic_ulong con;
+} pointer_t;
 
 typedef struct node {
        unsigned value;