feat(tree): add rwlock
This commit is contained in:
parent
83b3198a49
commit
1c563d8421
3 changed files with 32 additions and 0 deletions
|
|
@ -67,4 +67,22 @@ void vieter_tree_iterator_free(vieter_tree_iterator **ptp);
|
|||
vieter_tree_error vieter_tree_iterator_next(void **out,
|
||||
vieter_tree_iterator *iter);
|
||||
|
||||
/*
|
||||
* Acquire a read lock on the tree. Return value is the result of
|
||||
* pthread_rwlock_rdlock.
|
||||
*/
|
||||
int vieter_tree_rlock(vieter_tree *tree);
|
||||
|
||||
/*
|
||||
* Acquire a write lock on the tree. Return value is the result of
|
||||
* pthread_rwlock_wrlock.
|
||||
*/
|
||||
int vieter_tree_wlock(vieter_tree *tree);
|
||||
|
||||
/*
|
||||
* Unlock the lock after having acquired it. Return value is the result of
|
||||
* pthread_rwlock_unlock.
|
||||
*/
|
||||
int vieter_tree_unlock(vieter_tree *tree);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Reference in a new issue