X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=urcu%2Fstatic%2Flfstack.h;h=7afe71e2f0eb82de8944e117666c3bfca484cb65;hp=41895a6087a95daee07a7247786c77bd16d706b8;hb=f9b5c2b65a8a2605fc83e84e2c20e6f09033670d;hpb=e15df1cc24bf510057fd0fc950eadf1c09575923 diff --git a/urcu/static/lfstack.h b/urcu/static/lfstack.h index 41895a6..7afe71e 100644 --- a/urcu/static/lfstack.h +++ b/urcu/static/lfstack.h @@ -169,9 +169,13 @@ bool _cds_lfs_push(cds_lfs_stack_ptr_t u_s, * __cds_lfs_pop needs to be synchronized using one of the following * techniques: * - * 1) Calling __cds_lfs_pop under rcu read lock critical section. The - * caller must wait for a grace period to pass before freeing the - * returned node or modifying the cds_lfs_node structure. + * 1) Calling __cds_lfs_pop under rcu read lock critical section. + * Both __cds_lfs_pop and __cds_lfs_pop_all callers must wait for a + * grace period to pass before freeing the returned node or pushing + * the node back into the stack. It is valid to overwrite the content + * of cds_lfs_node immediately after __cds_lfs_pop and + * __cds_lfs_pop_all. No RCU read-side critical section is needed + * around __cds_lfs_pop_all. * 2) Using mutual exclusion (e.g. mutexes) to protect __cds_lfs_pop * and __cds_lfs_pop_all callers. * 3) Ensuring that only ONE thread can call __cds_lfs_pop() and @@ -213,10 +217,12 @@ struct cds_lfs_node *___cds_lfs_pop(cds_lfs_stack_ptr_t u_s) * matching the technique used to synchronize __cds_lfs_pop: * * 1) If __cds_lfs_pop is called under rcu read lock critical section, - * both __cds_lfs_pop and cds_lfs_pop_all callers must wait for a - * grace period to pass before freeing the returned node or modifying - * the cds_lfs_node structure. However, no RCU read-side critical - * section is needed around __cds_lfs_pop_all. + * both __cds_lfs_pop and __cds_lfs_pop_all callers must wait for a + * grace period to pass before freeing the returned node or pushing + * the node back into the stack. It is valid to overwrite the content + * of cds_lfs_node immediately after __cds_lfs_pop and + * __cds_lfs_pop_all. No RCU read-side critical section is needed + * around __cds_lfs_pop_all. * 2) Using mutual exclusion (e.g. mutexes) to protect __cds_lfs_pop and * __cds_lfs_pop_all callers. * 3) Ensuring that only ONE thread can call __cds_lfs_pop() and