X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=src%2Frculfhash.c;h=51972c8d1b318c618776a8d0b4b26e5373b9dbae;hp=ff42df0aef30ecf567da51014cdd0a7c6235c96f;hb=afa5940dbe80a259cf8bc4a99403554a3c2c9e32;hpb=83e334d03eaba62df373cf44298616458900078a diff --git a/src/rculfhash.c b/src/rculfhash.c index ff42df0..51972c8 100644 --- a/src/rculfhash.c +++ b/src/rculfhash.c @@ -273,6 +273,7 @@ #include #include #include +#include #include #include #include @@ -825,7 +826,7 @@ struct cds_lfht_node *clear_flag(struct cds_lfht_node *node) } static -int is_removed(struct cds_lfht_node *node) +int is_removed(const struct cds_lfht_node *node) { return ((unsigned long) node) & REMOVED_FLAG; } @@ -1829,7 +1830,7 @@ int cds_lfht_del(struct cds_lfht *ht, struct cds_lfht_node *node) return ret; } -int cds_lfht_is_node_deleted(struct cds_lfht_node *node) +int cds_lfht_is_node_deleted(const struct cds_lfht_node *node) { return is_removed(CMM_LOAD_SHARED(node->next)); } @@ -2151,18 +2152,24 @@ static struct urcu_atfork cds_lfht_atfork = { .after_fork_child = cds_lfht_after_fork_child, }; -/* Block all signals to ensure we don't disturb the application. */ +/* + * Block all signals for the workqueue worker thread to ensure we don't + * disturb the application. The SIGRCU signal needs to be unblocked for + * the urcu-signal flavor. + */ static void cds_lfht_worker_init(struct urcu_workqueue *workqueue, void *priv) { int ret; sigset_t mask; - /* Block signal for entire process, so only our thread processes it. */ ret = sigfillset(&mask); if (ret) urcu_die(errno); - ret = pthread_sigmask(SIG_BLOCK, &mask, NULL); + ret = sigdelset(&mask, SIGRCU); + if (ret) + urcu_die(errno); + ret = pthread_sigmask(SIG_SETMASK, &mask, NULL); if (ret) urcu_die(ret); }