X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=urcu%2Fstatic%2Flfstack.h;fp=urcu%2Fstatic%2Flfstack.h;h=967071a0cffcf74ba86465362efb7ae1fb17514f;hb=93aee570e96c48843659caa12667ff7157734532;hp=b49eb205a45ab3e5f409fc2ee9c490aa04e73e0e;hpb=96bd49dfcb6476da907cf7ebd9e245014879e9f2;p=urcu.git diff --git a/urcu/static/lfstack.h b/urcu/static/lfstack.h index b49eb20..967071a 100644 --- a/urcu/static/lfstack.h +++ b/urcu/static/lfstack.h @@ -66,7 +66,8 @@ void _cds_lfs_node_init(struct cds_lfs_node *node) } /* - * cds_lfs_init: initialize lock-free stack. + * cds_lfs_init: initialize lock-free stack (with lock). Pair with + * cds_lfs_destroy(). */ static inline void _cds_lfs_init(struct cds_lfs_stack *s) @@ -78,6 +79,17 @@ void _cds_lfs_init(struct cds_lfs_stack *s) assert(!ret); } +/* + * cds_lfs_destroy: destroy lock-free stack (with lock). Pair with + * cds_lfs_init(). + */ +static inline +void _cds_lfs_destroy(struct cds_lfs_stack *s) +{ + int ret = pthread_mutex_destroy(&s->lock); + assert(!ret); +} + static inline bool ___cds_lfs_empty_head(struct cds_lfs_head *head) {