diff options
| -rw-r--r-- | dtoa_config.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/dtoa_config.h b/dtoa_config.h index 294351d..380e83b 100644 --- a/dtoa_config.h +++ b/dtoa_config.h | |||
| @@ -50,12 +50,20 @@ static pthread_mutex_t private_dtoa_lock[2] = { | |||
| 50 | PTHREAD_MUTEX_INITIALIZER | 50 | PTHREAD_MUTEX_INITIALIZER |
| 51 | }; | 51 | }; |
| 52 | 52 | ||
| 53 | #define ACQUIRE_DTOA_LOCK(n) do { \ | 53 | #define ACQUIRE_DTOA_LOCK(n) do { \ |
| 54 | pthread_mutex_lock(&private_dtoa_lock[n]); \ | 54 | int r = pthread_mutex_lock(&private_dtoa_lock[n]); \ |
| 55 | if (r) { \ | ||
| 56 | fprintf(stderr, "pthread_mutex_lock failed with %d\n", r); \ | ||
| 57 | abort(); \ | ||
| 58 | } \ | ||
| 55 | } while (0) | 59 | } while (0) |
| 56 | 60 | ||
| 57 | #define FREE_DTOA_LOCK(n) do { \ | 61 | #define FREE_DTOA_LOCK(n) do { \ |
| 58 | pthread_mutex_unlock(&private_dtoa_lock[n]); \ | 62 | int r = pthread_mutex_unlock(&private_dtoa_lock[n]); \ |
| 63 | if (r) { \ | ||
| 64 | fprintf(stderr, "pthread_mutex_unlock failed with %d\n", r);\ | ||
| 65 | abort(); \ | ||
| 66 | } \ | ||
| 59 | } while (0) | 67 | } while (0) |
| 60 | 68 | ||
| 61 | #endif /* MULTIPLE_THREADS */ | 69 | #endif /* MULTIPLE_THREADS */ |
