Browse Source

Fix GNU atomic builtins

The ones that were being used returned the previous value rather than
the new value
jp9000 11 years ago
parent
commit
6c904650b3
1 changed files with 2 additions and 2 deletions
  1. 2 2
      libobs/util/threading-posix.c

+ 2 - 2
libobs/util/threading-posix.c

@@ -238,10 +238,10 @@ int  os_sem_wait(os_sem_t sem)
 
 long os_atomic_inc_long(volatile long *val)
 {
-	return __sync_fetch_and_add(val, 1);
+	return __sync_add_and_fetch(val, 1);
 }
 
 long os_atomic_dec_long(volatile long *val)
 {
-	return __sync_fetch_and_sub(val, 1);
+	return __sync_sub_and_fetch(val, 1);
 }