summaryrefslogtreecommitdiff
path: root/innobase/sync/sync0rw.c
diff options
context:
space:
mode:
Diffstat (limited to 'innobase/sync/sync0rw.c')
-rw-r--r--innobase/sync/sync0rw.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/innobase/sync/sync0rw.c b/innobase/sync/sync0rw.c
index 629331d6049..337fd3d77fd 100644
--- a/innobase/sync/sync0rw.c
+++ b/innobase/sync/sync0rw.c
@@ -132,6 +132,10 @@ rw_lock_create_func(
lock->last_x_line = 0;
lock->event = os_event_create(NULL);
+#ifdef __WIN__
+ lock->wait_ex_event = os_event_create(NULL);
+#endif
+
mutex_enter(&rw_lock_list_mutex);
if (UT_LIST_GET_LEN(rw_lock_list) > 0) {
@@ -168,6 +172,10 @@ rw_lock_free(
mutex_enter(&rw_lock_list_mutex);
os_event_free(lock->event);
+#ifdef __WIN__
+ os_event_free(lock->wait_ex_event);
+#endif
+
if (UT_LIST_GET_PREV(list, lock)) {
ut_a(UT_LIST_GET_PREV(list, lock)->magic_n == RW_LOCK_MAGIC_N);
}
@@ -521,7 +529,15 @@ lock_loop:
rw_x_system_call_count++;
sync_array_reserve_cell(sync_primary_wait_array,
- lock, RW_LOCK_EX,
+ lock,
+#ifdef __WIN__
+ /* On windows RW_LOCK_WAIT_EX signifies
+ that this thread should wait on the
+ special wait_ex_event. */
+ (state == RW_LOCK_WAIT_EX)
+ ? RW_LOCK_WAIT_EX :
+#endif
+ RW_LOCK_EX,
file_name, line,
&index);