summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/os_common/os_fs_inmemory.c
diff options
context:
space:
mode:
authorAndrew Morton <andrew.morton@mongodb.com>2023-05-16 22:21:25 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-05-17 00:50:01 +0000
commit376eae9eefe9f752d8d9b5189528f1353c019e54 (patch)
tree8780daf7a9ebd0ed2e8c1b25bf81571b3bb89911 /src/third_party/wiredtiger/src/os_common/os_fs_inmemory.c
parente94168acd89dba4faef5e43f970633a781e8cba2 (diff)
downloadmongo-376eae9eefe9f752d8d9b5189528f1353c019e54.tar.gz
Import wiredtiger: 04dcc362042b8cc35fdd8de8343be3a15d4fa47c from branch mongodb-master
ref: d310d6330e..04dcc36204 for: 7.1.0-rc0 WT-10898 Add assertions for owning a spinlock
Diffstat (limited to 'src/third_party/wiredtiger/src/os_common/os_fs_inmemory.c')
-rw-r--r--src/third_party/wiredtiger/src/os_common/os_fs_inmemory.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/src/os_common/os_fs_inmemory.c b/src/third_party/wiredtiger/src/os_common/os_fs_inmemory.c
index 9450cbba1d5..8e71b399f56 100644
--- a/src/third_party/wiredtiger/src/os_common/os_fs_inmemory.c
+++ b/src/third_party/wiredtiger/src/os_common/os_fs_inmemory.c
@@ -34,6 +34,7 @@ __im_handle_search(WT_SESSION_IMPL *session, WT_FILE_SYSTEM *file_system, const
uint64_t bucket, hash;
im_fs = (WT_FILE_SYSTEM_INMEM *)file_system;
+ WT_ASSERT_SPINLOCK_OWNED(session, &im_fs->lock);
hash = __wt_hash_city64(name, strlen(name));
bucket = hash & (S2C(session)->hash_size - 1);
@@ -58,6 +59,13 @@ __im_handle_remove(
im_fs = (WT_FILE_SYSTEM_INMEM *)file_system;
+ /*
+ * We should hold the file system lock unless we are destroying the file system, in which case
+ * would call this with the force argument set to true.
+ */
+ if (!force)
+ WT_ASSERT_SPINLOCK_OWNED(session, &im_fs->lock);
+
if (im_fh->ref != 0) {
__wt_err(session, EBUSY, "%s: file-remove", im_fh->iface.name);
if (!force)