Barrelfish
|
Implementation of a synchronous locking API using the octopus Interface. More...
Functions | |
errval_t | oct_lock (const char *lock_name, char **lock_record) |
Synchronous locking function. More... | |
errval_t | oct_unlock (const char *lock_record) |
Synchronous unlock function. More... | |
Implementation of a synchronous locking API using the octopus Interface.
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.
[in] | lock_name | Name to identify the lock. |
[out] | lock_record | Your 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.
[in] | lock_record | Record provided by oct_lock. |