summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/test/windows/windows_shim.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/test/windows/windows_shim.c')
-rw-r--r--src/third_party/wiredtiger/test/windows/windows_shim.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/test/windows/windows_shim.c b/src/third_party/wiredtiger/test/windows/windows_shim.c
index 6e8da8f86d4..b161b29c2fa 100644
--- a/src/third_party/wiredtiger/test/windows/windows_shim.c
+++ b/src/third_party/wiredtiger/test/windows/windows_shim.c
@@ -105,6 +105,17 @@ pthread_rwlock_unlock(pthread_rwlock_t *rwlock)
}
int
+pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock)
+{
+ if (TryAcquireSRWLockExclusive(&rwlock->rwlock)) {
+ rwlock->exclusive_locked = GetCurrentThreadId();
+ return (0);
+ }
+
+ return (EBUSY);
+}
+
+int
pthread_rwlock_wrlock(pthread_rwlock_t *rwlock)
{
AcquireSRWLockExclusive(&rwlock->rwlock);