aboutsummaryrefslogtreecommitdiff
path: root/src/platform/posix
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-06-25 09:57:00 -0700
committerGarrett D'Amore <garrett@damore.org>2017-06-25 09:57:00 -0700
commitcabebe8bc26d7a01f51e8daf9640f038378547f3 (patch)
treeb88f94557f34c42ce6fa90aa014100247cf3a080 /src/platform/posix
parent3678880128c98f522dc3608535e5351b1d5bc4c4 (diff)
downloadnng-cabebe8bc26d7a01f51e8daf9640f038378547f3.tar.gz
nng-cabebe8bc26d7a01f51e8daf9640f038378547f3.tar.bz2
nng-cabebe8bc26d7a01f51e8daf9640f038378547f3.zip
Clear the owner while *still* holding the lock.
Diffstat (limited to 'src/platform/posix')
-rw-r--r--src/platform/posix/posix_thread.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/platform/posix/posix_thread.c b/src/platform/posix/posix_thread.c
index d3b6c1e1..5abeaded 100644
--- a/src/platform/posix/posix_thread.c
+++ b/src/platform/posix/posix_thread.c
@@ -89,10 +89,10 @@ nni_plat_mtx_unlock(nni_plat_mtx *mtx)
int rv;
NNI_ASSERT(mtx->owner == pthread_self());
+ mtx->owner = 0;
if ((rv = pthread_mutex_unlock(&mtx->mtx)) != 0) {
nni_panic("pthread_mutex_unlock: %s", strerror(rv));
}
- mtx->owner = 0;
}