Explorar o código

fix memory coherency of spin_unlock: else loads/stores to memory may be done after the release

Samuel Thibault %!s(int64=16) %!d(string=hai) anos
pai
achega
7a566f4749
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/common/starpu-spinlock.c

+ 1 - 1
src/common/starpu-spinlock.c

@@ -66,7 +66,7 @@ int starpu_spin_unlock(starpu_spinlock_t *lock)
 #ifdef HAVE_PTHREAD_SPIN_LOCK
 	return pthread_spin_unlock(&lock->lock);
 #else
-	lock->taken = 0;
+	__sync_lock_release(&lock->taken);
 	return 0;
 #endif
 }