Permalink
Browse files

Move atomic.h/atomic.h to utils/.

  • Loading branch information...
1 parent 2a2f1cf commit 7547f6f2f1162a62129e669710053e7c2b8293ad @vargaz vargaz committed Mar 28, 2013
@@ -11,7 +11,6 @@ libwapiincludedir = $(includedir)/mono-$(API_VER)/mono/io-layer
OTHER_H = \
access.h \
- atomic.h \
collection.h \
context.h \
critical-sections.h \
@@ -41,8 +40,6 @@ OTHER_H = \
OTHER_SRC = \
access.h \
- atomic.c \
- atomic.h \
collection.c \
collection.h \
context.c \
View
@@ -15,7 +15,6 @@
#include <mono/io-layer/handles.h>
#include <mono/io-layer/io.h>
#include <mono/io-layer/access.h>
-#include <mono/io-layer/atomic.h>
#include <mono/io-layer/context.h>
#include <mono/io-layer/critical-sections.h>
#include <mono/io-layer/error.h>
@@ -60,6 +60,7 @@
#include <mono/utils/mono-stdlib.h>
#include <mono/utils/mono-io-portability.h>
#include <mono/utils/mono-error-internals.h>
+#include <mono/utils/atomic.h>
#ifdef HOST_WIN32
#include <direct.h>
#endif
View
@@ -34,6 +34,7 @@
#include <mono/metadata/reflection.h>
#include <mono/metadata/coree.h>
#include <mono/utils/mono-io-portability.h>
+#include <mono/utils/atomic.h>
#ifndef HOST_WIN32
#include <sys/types.h>
View
@@ -16,9 +16,6 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#if !HOST_WIN32
-#include <mono/io-layer/atomic.h>
-#endif
#include <mono/metadata/image.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/metadata.h>
@@ -44,6 +41,7 @@
#include <mono/utils/mono-error-internals.h>
#include <mono/utils/mono-logger-internal.h>
#include <mono/utils/mono-memory-model.h>
+#include <mono/utils/atomic.h>
MonoStats mono_stats;
gboolean mono_print_vtable = FALSE;
@@ -32,6 +32,7 @@
#include "mono/metadata/attrdefs.h"
#include "mono/metadata/gc-internal.h"
#include "mono/utils/mono-counters.h"
+#include "mono/utils/atomic.h"
#include <string.h>
#include <errno.h>
View
@@ -36,6 +36,7 @@
#include <mono/utils/mono-counters.h>
#include <mono/utils/dtrace.h>
#include <mono/utils/mono-threads.h>
+#include <mono/utils/atomic.h>
#ifndef HOST_WIN32
#include <pthread.h>
View
@@ -31,6 +31,7 @@
#include <mono/utils/mono-path.h>
#include <mono/utils/mono-mmap.h>
#include <mono/utils/mono-io-portability.h>
+#include <mono/utils/atomic.h>
#include <mono/metadata/class-internals.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/object-internals.h>
View
@@ -38,6 +38,7 @@
#include "mono/utils/mono-counters.h"
#include "mono/utils/mono-tls.h"
#include "mono/utils/mono-memory-model.h"
+#include "mono/utils/atomic.h"
#include <string.h>
#include <errno.h>
View
@@ -26,6 +26,7 @@
#include <mono/metadata/marshal.h>
#include <mono/metadata/profiler-private.h>
#include <mono/utils/mono-time.h>
+#include <mono/utils/atomic.h>
/*
* Pull the list of opcodes
View
@@ -12,6 +12,7 @@
#include <mono/metadata/mono-cq.h>
#include <mono/metadata/mono-mlist.h>
#include <mono/utils/mono-memory-model.h>
+#include <mono/utils/atomic.h>
#define CQ_DEBUG(...)
//#define CQ_DEBUG(...) g_message(__VA_ARGS__)
@@ -38,6 +38,7 @@
#include "utils/mono-proclib.h"
#include "utils/mono-networkinterfaces.h"
#include "utils/mono-error-internals.h"
+#include "utils/atomic.h"
#include <mono/io-layer/io-layer.h>
/* map of CounterSample.cs */
View
@@ -13,6 +13,7 @@
#include <mono/metadata/mono-wsq.h>
#include <mono/utils/mono-semaphore.h>
#include <mono/utils/mono-tls.h>
+#include <mono/utils/atomic.h>
#define INITIAL_LENGTH 32
#define WSQ_DEBUG(...)
View
@@ -39,6 +39,7 @@ typedef struct _SgenThreadInfo SgenThreadInfo;
#include <mono/utils/mono-threads.h>
#include <mono/utils/dtrace.h>
#include <mono/utils/mono-logger-internal.h>
+#include <mono/utils/atomic.h>
#include <mono/io-layer/mono-mutex.h>
#include <mono/metadata/class-internals.h>
#include <mono/metadata/object-internals.h>
@@ -29,6 +29,7 @@
#include <mono/utils/mono-time.h>
#include <mono/utils/mono-proclib.h>
#include <mono/utils/mono-semaphore.h>
+#include <mono/utils/atomic.h>
#include <errno.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
View
@@ -47,6 +47,7 @@
#include <mono/utils/mono-threads.h>
#include <mono/utils/hazard-pointer.h>
#include <mono/utils/mono-tls.h>
+#include <mono/utils/atomic.h>
#include <mono/metadata/gc-internal.h>
View
@@ -29,6 +29,7 @@
#include <mono/utils/mono-stack-unwinding.h>
#include <mono/utils/mono-threads.h>
#include <mono/utils/mono-tls.h>
+#include <mono/utils/atomic.h>
#define MONO_BREAKPOINT_ARRAY_SIZE 64
View
@@ -99,7 +99,9 @@ monoutils_sources = \
mono-threads.h \
mono-tls.h \
linux_magic.h \
- mono-memory-model.h
+ mono-memory-model.h \
+ atomic.h \
+ atomic.c
arch_sources =
File renamed without changes.
@@ -23,8 +23,6 @@
#include <glib.h>
-#include "mono/io-layer/wapi.h"
-
#if defined(__NetBSD__) && defined(HAVE_ATOMIC_OPS)
static inline gint32 InterlockedCompareExchange(volatile gint32 *dest,
@@ -82,7 +82,7 @@
#include <glib.h>
#include <stdlib.h>
-#include <mono/io-layer/io-layer.h>
+#include <mono/utils/atomic.h>
#include <mono/utils/mono-mmap.h>
#include <mono/utils/mono-membar.h>
#include <mono/utils/hazard-pointer.h>
@@ -16,7 +16,7 @@
* entry data, and then sets the state to USED or FREE.
*/
-#include <mono/io-layer/io-layer.h>
+#include <mono/utils/atomic.h>
#include <mono/utils/mono-membar.h>
#include <mono/utils/mono-mmap.h>
@@ -53,7 +53,7 @@
#include <mono/utils/mono-membar.h>
#include <mono/utils/hazard-pointer.h>
-#include <mono/io-layer/io-layer.h>
+#include <mono/utils/atomic.h>
#include <mono/utils/lock-free-queue.h>
@@ -16,8 +16,7 @@
#include <mono/utils/mono-linked-list-set.h>
-/*atomics.*/
-#include <mono/io-layer/io-layer.h>
+#include <mono/utils/atomic.h>
static inline gpointer
mask (gpointer n, uintptr_t bit)

1 comment on commit 7547f6f

There is a bug in a function is_dummy (MonoLockFreeQueue *q, MonoLockFreeQueueNode *n)
The condition n < &q->dummies [MONO_LOCK_FREE_QUEUE_NUM_DUMMIES].node;
is wrong because the array is declared as
MonoLockFreeQueueDummy dummies [MONO_LOCK_FREE_QUEUE_NUM_DUMMIES];
Bang, we read behind the array bounds

Please sign in to comment.