41 lines
1.4 KiB
Diff
41 lines
1.4 KiB
Diff
From 1a09a7264026339d8e0c4899a2f9ff488c0bd97d Mon Sep 17 00:00:00 2001
|
|
From: Natanael Copa <ncopa@alpinelinux.org>
|
|
Date: Mon, 10 Feb 2014 12:13:00 +0000
|
|
Subject: [PATCH 1/4] use portable pthread functions instead of the
|
|
non-portable
|
|
|
|
The pthread functions pthread_mutexattr_setrobust and
|
|
pthread_mutex_consistent are in posix nowdays. Use those instead of their
|
|
non-portable synonyms.
|
|
|
|
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
|
|
---
|
|
core/lock.c | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/core/lock.c b/core/lock.c
|
|
index d368148..f806b2c 100644
|
|
--- core/lock.c
|
|
+++ core/lock.c
|
|
@@ -99,7 +99,7 @@ retry:
|
|
exit(1);
|
|
}
|
|
if (uwsgi_pthread_robust_mutexes_enabled) {
|
|
- if (pthread_mutexattr_setrobust_np(&attr, PTHREAD_MUTEX_ROBUST)) {
|
|
+ if (pthread_mutexattr_setrobust(&attr, PTHREAD_MUTEX_ROBUST)) {
|
|
uwsgi_log("unable to make the mutex 'robust'\n");
|
|
exit(1);
|
|
}
|
|
@@ -161,7 +161,7 @@ void uwsgi_lock_fast(struct uwsgi_lock_item *uli) {
|
|
#ifdef EOWNERDEAD
|
|
if (pthread_mutex_lock((pthread_mutex_t *) uli->lock_ptr) == EOWNERDEAD) {
|
|
uwsgi_log("[deadlock-detector] a process holding a robust mutex died. recovering...\n");
|
|
- pthread_mutex_consistent_np((pthread_mutex_t *) uli->lock_ptr);
|
|
+ pthread_mutex_consistent((pthread_mutex_t *) uli->lock_ptr);
|
|
}
|
|
#else
|
|
pthread_mutex_lock((pthread_mutex_t *) uli->lock_ptr);
|
|
--
|
|
1.8.5.3
|
|
|