A lock for cooperative multitasking environment
Allocate and initialize the new latch.
Returns: allocated latch object Return type: box_latch_t *
Destroy and free the latch.
- latch (box_latch_t*) – latch to destroy
Lock a latch. Waits indefinitely until the current fiber can gain access to the latch.
param box_latch_t* latch: latch to lock
Try to lock a latch. Return immediately if the latch is locked.
- latch (box_latch_t*) – latch to lock
status of operation. 0 - success, 1 - latch is locked