@@ -49,14 +49,7 @@ my_bool srv_sync_debug;
49
49
/* * The global mutex which protects debug info lists of all rw-locks.
50
50
To modify the debug info list of an rw-lock, this mutex has to be
51
51
acquired in addition to the mutex protecting the lock. */
52
- static ib_mutex_t rw_lock_debug_mutex;
53
-
54
- /* * If deadlock detection does not get immediately the mutex,
55
- it may wait for this event */
56
- static os_event_t rw_lock_debug_event;
57
-
58
- /* * This is set to true, if there may be waiters for the event */
59
- static bool rw_lock_debug_waiters;
52
+ static SysMutex rw_lock_debug_mutex;
60
53
61
54
/* * The latch held by a thread */
62
55
struct Latched {
@@ -1242,13 +1235,7 @@ void
1242
1235
LatchDebug::init ()
1243
1236
UNIV_NOTHROW
1244
1237
{
1245
- ut_a (rw_lock_debug_event == NULL );
1246
-
1247
1238
mutex_create (LATCH_ID_RW_LOCK_DEBUG, &rw_lock_debug_mutex);
1248
-
1249
- rw_lock_debug_event = os_event_create (" rw_lock_debug_event" );
1250
-
1251
- rw_lock_debug_waiters = FALSE ;
1252
1239
}
1253
1240
1254
1241
/* * Shutdown the latch debug checking
@@ -1259,12 +1246,6 @@ void
1259
1246
LatchDebug::shutdown ()
1260
1247
UNIV_NOTHROW
1261
1248
{
1262
- ut_a (rw_lock_debug_event != NULL );
1263
-
1264
- os_event_destroy (rw_lock_debug_event);
1265
-
1266
- rw_lock_debug_event = NULL ;
1267
-
1268
1249
mutex_free (&rw_lock_debug_mutex);
1269
1250
1270
1251
ut_a (s_initialized);
@@ -1284,34 +1265,14 @@ mutex. */
1284
1265
void
1285
1266
rw_lock_debug_mutex_enter ()
1286
1267
{
1287
- for (;;) {
1288
-
1289
- if (0 == mutex_enter_nowait (&rw_lock_debug_mutex)) {
1290
- return ;
1291
- }
1292
-
1293
- os_event_reset (rw_lock_debug_event);
1294
-
1295
- rw_lock_debug_waiters = TRUE ;
1296
-
1297
- if (0 == mutex_enter_nowait (&rw_lock_debug_mutex)) {
1298
- return ;
1299
- }
1300
-
1301
- os_event_wait (rw_lock_debug_event);
1302
- }
1268
+ mutex_enter (&rw_lock_debug_mutex);
1303
1269
}
1304
1270
1305
1271
/* * Releases the debug mutex. */
1306
1272
void
1307
1273
rw_lock_debug_mutex_exit ()
1308
1274
{
1309
1275
mutex_exit (&rw_lock_debug_mutex);
1310
-
1311
- if (rw_lock_debug_waiters) {
1312
- rw_lock_debug_waiters = FALSE ;
1313
- os_event_set (rw_lock_debug_event);
1314
- }
1315
1276
}
1316
1277
#endif /* UNIV_DEBUG */
1317
1278
0 commit comments