diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-06-25 09:57:00 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-06-25 09:57:00 -0700 |
| commit | cabebe8bc26d7a01f51e8daf9640f038378547f3 (patch) | |
| tree | b88f94557f34c42ce6fa90aa014100247cf3a080 /src/platform | |
| parent | 3678880128c98f522dc3608535e5351b1d5bc4c4 (diff) | |
| download | nng-cabebe8bc26d7a01f51e8daf9640f038378547f3.tar.gz nng-cabebe8bc26d7a01f51e8daf9640f038378547f3.tar.bz2 nng-cabebe8bc26d7a01f51e8daf9640f038378547f3.zip | |
Clear the owner while *still* holding the lock.
Diffstat (limited to 'src/platform')
| -rw-r--r-- | src/platform/posix/posix_thread.c | 2 |
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; } |
