CodeBlockA;
Lock;
CodeBlockB;
Unlock;
CodeBlockC
Code block may contain a lot of code, just take it as a unit.
Is CodeBlockA CodeBlockB CodeBlockC always execute in serial? How lock achieve this?
CodeBlockA;
Lock;
CodeBlockB;
Unlock;
CodeBlockC
Code block may contain a lot of code, just take it as a unit.
Is CodeBlockA CodeBlockB CodeBlockC always execute in serial? How lock achieve this?
Now, i don't know about other systems but on linux it is like this:
pthreads
futex
C - mtx_lock
C Standard n2596