Split out architecture-dependent definitions into api.h and arch.h.
[urcu.git] / urcu.c
diff --git a/urcu.c b/urcu.c
index 5e2d2afff5641c57a80548c1f78469c52ccf7b09..475bebf526dfd1b9cc8cf78b87d8804ded7a1b6f 100644 (file)
--- a/urcu.c
+++ b/urcu.c
@@ -54,12 +54,17 @@ static int sig_done;
 
 void internal_urcu_lock(void)
 {
+#if 0
        int ret;
+       /* Mutex sleeping does not play well with busy-waiting loop. */
        ret = pthread_mutex_lock(&urcu_mutex);
        if (ret) {
                perror("Error in pthread mutex lock");
                exit(-1);
        }
+#endif
+       while (pthread_mutex_trylock(&urcu_mutex) != 0)
+               cpu_relax();
 }
 
 void internal_urcu_unlock(void)
This page took 0.021873 seconds and 4 git commands to generate.