upc_lock
function
#include <upc.h> void upc_lock(upc_lock_t *ptr);
The upc_lock
function sets the state of the lock pointed to by ptr
to locked.
If the lock is already in locked state due to the calling thread setting it to locked state, the result is undefined.
If the lock is already in locked state, then the calling thread waits for some other thread to set the state to unlocked.
Once the lock is in state unlocked, a single calling thread sets the state to locked and the function returns.
A null strict access is implied after a call to upc_lock().