projects
/
platform
/
upstream
/
lmdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
04acac6
)
ITS#8505 Protect parent from fork()-pthread_exit()
author
Hallvard Furuseth
<hallvard@openldap.org>
Tue, 27 Sep 2016 05:03:40 +0000
(07:03 +0200)
committer
Hallvard Furuseth
<hallvard@openldap.org>
Tue, 4 Oct 2016 19:16:27 +0000
(21:16 +0200)
libraries/liblmdb/mdb.c
patch
|
blob
|
history
diff --git
a/libraries/liblmdb/mdb.c
b/libraries/liblmdb/mdb.c
index
27582ae
..
af365b3
100644
(file)
--- a/
libraries/liblmdb/mdb.c
+++ b/
libraries/liblmdb/mdb.c
@@
-4747,7
+4747,11
@@
mdb_env_reader_dest(void *ptr)
{
MDB_reader *reader = ptr;
- reader->mr_pid = 0;
+#ifndef _WIN32
+ if (reader->mr_pid == getpid()) /* catch pthread_exit() in child process */
+#endif
+ /* We omit the mutex, so do this atomically (i.e. skip mr_txnid) */
+ reader->mr_pid = 0;
}
#ifdef _WIN32