From c8955fd7b89009f3c65eb2a6d6227249ea561fdb Mon Sep 17 00:00:00 2001 From: Luke Chen Date: Mon, 1 Aug 2022 14:08:12 +1000 Subject: Import wiredtiger: 0427579d14f4a274bb55eb84be954054e96242dc from branch mongodb-master ref: 8b0ee25694..0427579d14 for: 6.1.0-rc0 WT-9643 Fix pthread_mutex_destroy() failure during test_checkpoint. (#8169) --- src/third_party/wiredtiger/test/checkpoint/checkpointer.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/third_party/wiredtiger/test/checkpoint') diff --git a/src/third_party/wiredtiger/test/checkpoint/checkpointer.c b/src/third_party/wiredtiger/test/checkpoint/checkpointer.c index b7f73f20071..1e1e924659a 100644 --- a/src/third_party/wiredtiger/test/checkpoint/checkpointer.c +++ b/src/third_party/wiredtiger/test/checkpoint/checkpointer.c @@ -79,15 +79,24 @@ void end_threads(void) { if (g.tiered) { + /* + * The flush lock is also used by the worker threads. They have exited by the time this is + * called, so it is safe to destroy it. + */ testutil_check(__wt_thread_join(NULL, &g.flush_thread)); __wt_rwlock_destroy(NULL, &g.flush_lock); } + /* Shutdown checkpoint after flush thread completes because flush depends on checkpoint. */ + testutil_check(__wt_thread_join(NULL, &g.checkpoint_thread)); + if (g.use_timestamps) { + /* + * The clock lock is also used by the checkpoint thread. Now that it has exited it is safe + * to destroy that lock. + */ testutil_check(__wt_thread_join(NULL, &g.clock_thread)); __wt_rwlock_destroy(NULL, &g.clock_lock); } - /* Shutdown checkpoint after flush thread completes because flush depends on checkpoint. */ - testutil_check(__wt_thread_join(NULL, &g.checkpoint_thread)); } /* -- cgit v1.2.1