ovs-thread: Make caller provide thread name when creating a thread.
[sliver-openvswitch.git] / lib / ovs-rcu.c
index ac4513b..c1ac61a 100644 (file)
@@ -99,7 +99,7 @@ ovsrcu_quiesced(void)
     } else {
         static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER;
         if (ovsthread_once_start(&once)) {
-            xpthread_create(NULL, NULL, ovsrcu_postpone_thread, NULL);
+            ovs_thread_create("urcu", ovsrcu_postpone_thread, NULL);
             ovsthread_once_done(&once);
         }
     }
@@ -127,12 +127,20 @@ ovsrcu_quiesce_start(void)
 void
 ovsrcu_quiesce(void)
 {
+    ovsrcu_init();
     ovsrcu_perthread_get()->seqno = seq_read(global_seqno);
     seq_change(global_seqno);
 
     ovsrcu_quiesced();
 }
 
+bool
+ovsrcu_is_quiescent(void)
+{
+    ovsrcu_init();
+    return pthread_getspecific(perthread_key) == NULL;
+}
+
 static void
 ovsrcu_synchronize(void)
 {