workqueue: use int type for shutdown load/store
[userspace-rcu.git] / urcu / workqueue-fifo.h
index ff0c650571a175ae6c809eee41d9f3135131ce36..e2dd72f0c1dc66c47069c8b1f7292ff74938ee5c 100644 (file)
@@ -69,7 +69,7 @@ struct urcu_workqueue {
        unsigned long nr_work;          /* Current number of work items */
 
        int worker_flags;               /* Worker flags */
-       bool shutdown;                  /* Shutdown performed */
+       int shutdown;                   /* Shutdown performed */
 };
 
 struct urcu_worker {
@@ -514,13 +514,15 @@ bool urcu_workqueue_steal_all(struct urcu_workqueue *queue,
        struct urcu_worker *sibling;
        bool has_work = false;
 
-       rcu_read_lock();
-       /* Steal from each worker */
-       cds_list_for_each_entry_rcu(sibling, &queue->sibling_head,
-                       sibling_node)
-               has_work |= ___urcu_grab_work(worker, &sibling->head,
-                                       &sibling->tail, 1);
-       rcu_read_unlock();
+       if (worker->flags & URCU_WORKER_STEAL) {
+               rcu_read_lock();
+               /* Steal from each worker */
+               cds_list_for_each_entry_rcu(sibling, &queue->sibling_head,
+                               sibling_node)
+                       has_work |= ___urcu_grab_work(worker, &sibling->head,
+                                               &sibling->tail, 1);
+               rcu_read_unlock();
+       }
 
        /* Steal from global workqueue */
        has_work |= ___urcu_grab_work(worker, &queue->head, &queue->tail, 0);
This page took 0.024192 seconds and 4 git commands to generate.