summaryrefslogtreecommitdiff
path: root/src/upb_atomic.h
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2010-07-09 19:25:39 -0700
committerJoshua Haberman <joshua@reverberate.org>2010-07-09 19:25:39 -0700
commitbe5ddd8a645eaa949a8d500718257fb7cb71cf44 (patch)
tree5858669f1f0d2324dc779f60c01b01f015bb2d74 /src/upb_atomic.h
parent209dce5eb08709bfb5b21e19289b3814619ca6cc (diff)
Tweaks to upb_src/upb_sink interfaces.
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