Commit 3147ec22 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

force memory barrier on unlock.


Former-commit-id: a0fabfb1a0670c165c72008aee48a98a67f9011d
parent f021bd3d
......@@ -45,5 +45,5 @@
return 0;
}
#define lock_trylock( l ) ( ( *(l) ) ? 1 : __sync_val_compare_and_swap( l , 0 , 1 ) )
#define lock_unlock( l ) ( *l = 0 )
#define lock_unlock( l ) ( __sync_lock_test_and_set( l , 0 ) != 1 )
#endif
......@@ -1371,7 +1371,8 @@ void *runner_main ( void *data ) {
/* Resolve any dependencies. */
for ( k = 0 ; k < t->nr_unlock_tasks ; k++ )
__sync_fetch_and_sub( &t->unlock_tasks[k]->wait , 1 );
if ( __sync_fetch_and_sub( &t->unlock_tasks[k]->wait , 1 ) == 0 )
abort();
for ( k = 0 ; k < t->nr_unlock_cells ; k++ )
__sync_fetch_and_sub( &t->unlock_cells[k]->wait , 1 );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment