- /* Probably doesn't need to be atomic. Still, better avoid surprises */
- return __sync_lock_test_and_set (&f->has_event, 1) == 0;
+ /* return __sync_lock_test_and_set (&f->has_event, 1) == 0;
+ return __sync_bool_compare_and_swap (&f->has_event, 0, 1); */
+ return !__atomic_exchange_n (&f->has_event, 1, __ATOMIC_RELEASE);