j
k
j a
j l
Tyson Whitehead wrote:
A simple solution is to initialize the counter to zero and replace the above lock by: while( __exchange_and_add(&m_.a_, 1) ){ __atomic_add(&m_.a_, -1); sched_yield(); } and the unlock by: __atomic_add(&m_.a_, -1);
A simple solution is to initialize the counter to zero and replace the above lock by:
while( __exchange_and_add(&m_.a_, 1) ){ __atomic_add(&m_.a_, -1); sched_yield(); }
and the unlock by: __atomic_add(&m_.a_, -1);
Applied, thanks.
Back to the thread
Back to the list