summaryrefslogtreecommitdiffstats
path: root/test/src/mtx.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/src/mtx.c')
-rw-r--r--test/src/mtx.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/test/src/mtx.c b/test/src/mtx.c
index bbfec4a..924ba28 100644
--- a/test/src/mtx.c
+++ b/test/src/mtx.c
@@ -5,11 +5,12 @@
#endif
bool
-mtx_init(mtx_t *mtx)
-{
+mtx_init(mtx_t *mtx) {
#ifdef _WIN32
- if (!InitializeCriticalSectionAndSpinCount(&mtx->lock, _CRT_SPINCOUNT))
+ if (!InitializeCriticalSectionAndSpinCount(&mtx->lock,
+ _CRT_SPINCOUNT)) {
return (true);
+ }
#elif (defined(JEMALLOC_OS_UNFAIR_LOCK))
mtx->lock = OS_UNFAIR_LOCK_INIT;
#elif (defined(JEMALLOC_OSSPIN))
@@ -17,8 +18,9 @@ mtx_init(mtx_t *mtx)
#else
pthread_mutexattr_t attr;
- if (pthread_mutexattr_init(&attr) != 0)
+ if (pthread_mutexattr_init(&attr) != 0) {
return (true);
+ }
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_DEFAULT);
if (pthread_mutex_init(&mtx->lock, &attr) != 0) {
pthread_mutexattr_destroy(&attr);
@@ -30,8 +32,7 @@ mtx_init(mtx_t *mtx)
}
void
-mtx_fini(mtx_t *mtx)
-{
+mtx_fini(mtx_t *mtx) {
#ifdef _WIN32
#elif (defined(JEMALLOC_OS_UNFAIR_LOCK))
#elif (defined(JEMALLOC_OSSPIN))
@@ -41,8 +42,7 @@ mtx_fini(mtx_t *mtx)
}
void
-mtx_lock(mtx_t *mtx)
-{
+mtx_lock(mtx_t *mtx) {
#ifdef _WIN32
EnterCriticalSection(&mtx->lock);
#elif (defined(JEMALLOC_OS_UNFAIR_LOCK))
@@ -55,8 +55,7 @@ mtx_lock(mtx_t *mtx)
}
void
-mtx_unlock(mtx_t *mtx)
-{
+mtx_unlock(mtx_t *mtx) {
#ifdef _WIN32
LeaveCriticalSection(&mtx->lock);
#elif (defined(JEMALLOC_OS_UNFAIR_LOCK))