summaryrefslogtreecommitdiff
path: root/src/upb_atomic.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/upb_atomic.h')
-rw-r--r--src/upb_atomic.h23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/upb_atomic.h b/src/upb_atomic.h
index c2cb8ba..01fc8a2 100644
--- a/src/upb_atomic.h
+++ b/src/upb_atomic.h
@@ -29,7 +29,6 @@ extern "C" {
#define INLINE static inline
#endif
-#define UPB_THREAD_UNSAFE
#ifdef UPB_THREAD_UNSAFE
/* Non-thread-safe implementations. ******************************************/
@@ -65,15 +64,6 @@ INLINE int upb_atomic_fetch_and_add(upb_atomic_refcount_t *a, int val) {
return ret;
}
-typedef struct {
-} upb_rwlock_t;
-
-INLINE void upb_rwlock_init(upb_rwlock_t *l) { (void)l; }
-INLINE void upb_rwlock_destroy(upb_rwlock_t *l) { (void)l; }
-INLINE void upb_rwlock_rdlock(upb_rwlock_t *l) { (void)l; }
-INLINE void upb_rwlock_wrlock(upb_rwlock_t *l) { (void)l; }
-INLINE void upb_rwlock_unlock(upb_rwlock_t *l) { (void)l; }
-
#endif
/* Atomic refcount ************************************************************/
@@ -111,10 +101,6 @@ INLINE bool upb_atomic_read(upb_atomic_refcount_t *a) {
return __sync_fetch_and_add(&a->v, 0);
}
-INLINE bool upb_atomic_write(upb_atomic_refcount_t *a, int val) {
- a->v = val;
-}
-
#elif defined(WIN32)
/* Windows defines atomic increment/decrement. */
@@ -145,7 +131,14 @@ INLINE bool upb_atomic_unref(upb_atomic_refcount_t *a) {
#ifdef UPB_THREAD_UNSAFE
-/* Already defined. */
+typedef struct {
+} upb_rwlock_t;
+
+INLINE void upb_rwlock_init(upb_rwlock_t *l) { (void)l; }
+INLINE void upb_rwlock_destroy(upb_rwlock_t *l) { (void)l; }
+INLINE void upb_rwlock_rdlock(upb_rwlock_t *l) { (void)l; }
+INLINE void upb_rwlock_wrlock(upb_rwlock_t *l) { (void)l; }
+INLINE void upb_rwlock_unlock(upb_rwlock_t *l) { (void)l; }
#elif defined(UPB_USE_PTHREADS)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback