Skip to content

Commit 56945e2

Browse files
eramongodbvdimir
authored andcommitted
CDRIVER-3685 address TSAN warning for mongoc_handshake_t::frozen (mongodb#1698)
(cherry picked from commit 63b780e)
1 parent 036d59f commit 56945e2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

.tsan-suppressions

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
race:mongoc_counter*
2-
race:_mongoc_handshake_freeze

src/libmongoc/src/mongoc/mongoc-handshake.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,9 @@ _mongoc_handshake_build_doc_with_application (const char *appname)
720720
void
721721
_mongoc_handshake_freeze (void)
722722
{
723+
bson_mutex_lock (&gHandshakeLock);
723724
_mongoc_handshake_get ()->frozen = true;
725+
bson_mutex_unlock (&gHandshakeLock);
724726
}
725727

726728
/*

0 commit comments

Comments
 (0)