mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 16:54:13 +08:00
mdbx: avoid tsan-collision by mdb_env_reader_destr().
Change-Id: Ic87e67db6337e2e1fe1bc21d5e2bbde64b21935b
This commit is contained in:
parent
c9c0549b4f
commit
9d14f6a2ac
8
mdb.c
8
mdb.c
@ -4511,16 +4511,12 @@ static pthread_mutex_t mdb_rthc_lock = PTHREAD_MUTEX_INITIALIZER;
|
|||||||
|
|
||||||
/* LY: TODO: Yet another problem is here - segfault in case if a DSO will
|
/* LY: TODO: Yet another problem is here - segfault in case if a DSO will
|
||||||
* be unloaded before a thread would been finished. */
|
* be unloaded before a thread would been finished. */
|
||||||
static void
|
static ATTRIBUTE_NO_SANITIZE_THREAD
|
||||||
mdb_env_reader_destr(void *ptr)
|
void mdb_env_reader_destr(void *ptr)
|
||||||
{
|
{
|
||||||
struct MDB_rthc* rthc = ptr;
|
struct MDB_rthc* rthc = ptr;
|
||||||
MDB_reader *reader;
|
MDB_reader *reader;
|
||||||
|
|
||||||
if (! rthc)
|
|
||||||
/* LY: paranoia */
|
|
||||||
return;
|
|
||||||
|
|
||||||
mdb_ensure(NULL, pthread_mutex_lock(&mdb_rthc_lock) == 0);
|
mdb_ensure(NULL, pthread_mutex_lock(&mdb_rthc_lock) == 0);
|
||||||
reader = rthc->rc_reader;
|
reader = rthc->rc_reader;
|
||||||
if (reader && reader->mr_pid == getpid()) {
|
if (reader && reader->mr_pid == getpid()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user