Stub implementations, for testing.
(Temporary: need to find a better generic atomic_int, atomic_long, etc.
implementation)
CC=gcc
BIN=libthreads
-SOURCE=libthreads.c schedule.c
-HEADERS=libthreads.h schedule.h common.h
+SOURCE=libthreads.c schedule.c libatomic.c
+HEADERS=libthreads.h schedule.h common.h libatomic.h
FLAGS=-Wall
all: ${BIN}
--- /dev/null
+#include "libatomic.h"
+#include "libthreads.h"
+
+void atomic_store_explicit(struct atomic_object *obj, int value, memory_order order)
+{
+ thread_yield();
+}
+
+int atomic_load_explicit(struct atomic_object *obj, memory_order order)
+{
+ thread_yield();
+ return 0;
+}
--- /dev/null
+#ifndef __LIBATOMIC_H__
+#define __LIBATOMIC_H__
+
+typedef enum memory_order {
+ memory_order_relaxed,
+ memory_order_consume,
+ memory_order_acquire,
+ memory_order_release,
+ memory_order_acq_rel,
+ memory_order_seq_cst
+} memory_order;
+
+typedef struct atomic_object {
+} atomic_int;
+
+void atomic_store_explicit(struct atomic_object *obj, int value, memory_order order);
+#define atomic_store(A, B) atomic_store_explicit((A), (B), memory_order_seq_cst)
+
+int atomic_load_explicit(struct atomic_object *obj, memory_order order);
+#define atomic_load(A) atomic_load_explicit((A), memory_order_seq_cst)
+
+#endif /* __LIBATOMIC_H__ */