Barrelfish
Functions
lock.h File Reference

Header file for lock related functions. More...

Functions

errval_t oct_lock (const char *, char **)
 Synchronous locking function. More...
 
errval_t oct_unlock (const char *)
 Synchronous unlock function. More...
 

Detailed Description

Header file for lock related functions.

Function Documentation

errval_t oct_lock ( const char *  lock_name,
char **  lock_record 
)

Synchronous locking function.

The lock function will create a new record based on the lock name using sequential set mode. This means we create a queue of records with all parties that want to acquire the lock. The lock owner is the one with the lowest sequence appended to its name. Once the lock owner deletes its lock_record the next client in the queue is notified through triggers.

Note
Once a client holds the lock it can be released using oct_unlock.
Parameters
[in]lock_nameName to identify the lock.
[out]lock_recordYour current lock record in the queue. Client needs to free this.

XXX why is there a strdup ?

errval_t oct_unlock ( const char *  lock_record)

Synchronous unlock function.

Deletes the given lock_record in on the server.

Parameters
[in]lock_recordRecord provided by oct_lock.