Commit bb4462a1 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

force memory barrier on unlock.


Former-commit-id: 4e0eed1c3fd3aebe5b9f82ad085aa968dd40869e
parent 3147ec22
......@@ -45,5 +45,5 @@
return 0;
}
#define lock_trylock( l ) ( ( *(l) ) ? 1 : __sync_val_compare_and_swap( l , 0 , 1 ) )
#define lock_unlock( l ) ( __sync_lock_test_and_set( l , 0 ) != 1 )
#define lock_unlock( l ) ( __sync_val_compare_and_swap( l , 1 , 0 ) != 1 )
#endif
......@@ -1526,7 +1526,7 @@ struct task *queue_gettask ( struct queue *q , int blocking , int keep ) {
/* Bubble-up. */
q->count = qcount - 1;
for ( ; k < qcount ; k++)
for ( ; k < qcount - 1 ; k++ )
qtid[k] = qtid[k+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