code_junkie

Thread-safe atomic operations in gcc

Nov 11th, 2011
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. pthread_mutex_lock( &frame->mutex );
  2. frame->variable = variable;
  3. pthread_mutex_unlock( &frame->mutex );
  4.  
  5. asm("" : "=m" (variable));
  6. frame->variable = variable;
Add Comment
Please, Sign In to add comment