]> git.pld-linux.org Git - packages/gtk-webkit3.git/blobdiff - sync-builtins.patch
- completed dependencies, dropped obsolete todo entries
[packages/gtk-webkit3.git] / sync-builtins.patch
index 3c252b4f748ee855d655a01f4aac4ab7b3f3e540..3d94d3733cb724586e7bc8e658fffc8858f8150d 100644 (file)
  ######################################################################################
 --- webkitgtk-2.0.0/Source/WTF/wtf/Atomics.h~  2013-04-12 08:05:55.951740895 +0200
 +++ webkitgtk-2.0.0/Source/WTF/wtf/Atomics.h   2013-04-12 08:22:46.701992338 +0200
-@@ -113,8 +113,16 @@
+@@ -70,6 +70,9 @@
+ #elif OS(ANDROID)
+ #include <sys/atomics.h>
+ #endif
++#ifndef HAVE_64BIT_SYNC_BUILTINS
++#include <pthread.h>
++#endif
+ namespace WTF {
+@@ -113,8 +113,15 @@
  inline int atomicIncrement(int volatile* addend) { return __sync_add_and_fetch(addend, 1); }
  inline int atomicDecrement(int volatile* addend) { return __sync_sub_and_fetch(addend, 1); }
  
  inline int64_t atomicIncrement(int64_t volatile* addend) { return __sync_add_and_fetch(addend, 1); }
  inline int64_t atomicDecrement(int64_t volatile* addend) { return __sync_sub_and_fetch(addend, 1); }
 +#else
-+#include <pthread.h>
 +static pthread_mutex_t global_wtf_lock = PTHREAD_MUTEX_INITIALIZER;
 +
-+inline int64_t atomicIncrement(int64_t volatile* addend) { pthread_mutex_lock(&global_wtf_lock); addend++; pthread_mutex_unlock(&global_wtf_lock); return addend; }
-+inline int64_t atomicDecrement(int64_t volatile* addend) { pthread_mutex_lock(&global_wtf_lock); addend--; pthread_mutex_unlock(&global_wtf_lock); return addend; }
++inline int64_t atomicIncrement(int64_t volatile* addend) { pthread_mutex_lock(&global_wtf_lock); int64_t v = (*addend)++; pthread_mutex_unlock(&global_wtf_lock); return v; }
++inline int64_t atomicDecrement(int64_t volatile* addend) { pthread_mutex_lock(&global_wtf_lock); int64_t v = (*addend)--; pthread_mutex_unlock(&global_wtf_lock); return v; }
 +#endif
  
  #endif
This page took 0.077831 seconds and 4 git commands to generate.