X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=urcu-defer-impl.h;h=a7d0b2f7c45aa0a1054d70aac989293b63c87466;hp=f65e41086022f2613bdaf251611a378afb6e5a3d;hb=edac6b69ad8b690437c4624cebb7eef465a09a7e;hpb=bd252a04bbbb163aa4d8864b1e1e5a3a4d9d0892 diff --git a/urcu-defer-impl.h b/urcu-defer-impl.h index f65e410..a7d0b2f 100644 --- a/urcu-defer-impl.h +++ b/urcu-defer-impl.h @@ -49,6 +49,7 @@ #include #include #include +#include "urcu-die.h" /* * Number of entries in the per-thread defer queue. Must be power of 2. @@ -141,17 +142,12 @@ static void mutex_lock_defer(pthread_mutex_t *mutex) #ifndef DISTRUST_SIGNALS_EXTREME ret = pthread_mutex_lock(mutex); - if (ret) { - perror("Error in pthread mutex lock"); - exit(-1); - } + if (ret) + urcu_die(ret); #else /* #ifndef DISTRUST_SIGNALS_EXTREME */ while ((ret = pthread_mutex_trylock(mutex)) != 0) { - if (ret != EBUSY && ret != EINTR) { - printf("ret = %d, errno = %d\n", ret, errno); - perror("Error in pthread mutex lock"); - exit(-1); - } + if (ret != EBUSY && ret != EINTR) + urcu_die(ret); poll(NULL,0,10); } #endif /* #else #ifndef DISTRUST_SIGNALS_EXTREME */