@@ -128,19 +128,19 @@ TEST_VM_ASSERT_MSG(MutexRank, mutex_trylock_rank_out_of_orderB,
128
128
mutex_rankA->unlock ();
129
129
}
130
130
131
- TEST_VM_ASSERT_MSG (MutexRank, mutex_lock_access_leaf ,
132
- " .* Attempting to acquire lock mutex_rank_leaf/.* out of order with lock mutex_rank_access/1 "
131
+ TEST_VM_ASSERT_MSG (MutexRank, mutex_lock_event_leaf ,
132
+ " .* Attempting to acquire lock mutex_rank_leaf/.* out of order with lock mutex_rank_event/0 "
133
133
" -- possible deadlock" ) {
134
134
JavaThread* THREAD = JavaThread::current ();
135
135
ThreadInVMfromNative invm (THREAD);
136
136
137
- Mutex* mutex_rank_access = new Mutex (Mutex::access , " mutex_rank_access " , false , Mutex::_safepoint_check_never);
137
+ Mutex* mutex_rank_event = new Mutex (Mutex::event , " mutex_rank_event " , false , Mutex::_safepoint_check_never);
138
138
Mutex* mutex_rank_leaf = new Mutex (Mutex::leaf, " mutex_rank_leaf" , false , Mutex::_safepoint_check_never);
139
139
140
- mutex_rank_access ->lock_without_safepoint_check ();
140
+ mutex_rank_event ->lock_without_safepoint_check ();
141
141
mutex_rank_leaf->lock_without_safepoint_check ();
142
142
mutex_rank_leaf->unlock ();
143
- mutex_rank_access ->unlock ();
143
+ mutex_rank_event ->unlock ();
144
144
}
145
145
146
146
TEST_VM_ASSERT_MSG (MutexRank, mutex_lock_tty_special,
@@ -220,19 +220,19 @@ TEST_VM_ASSERT_MSG(MutexRank, monitor_wait_rank_special,
220
220
monitor_rank_special->unlock ();
221
221
}
222
222
223
- TEST_VM_ASSERT_MSG (MutexRank, monitor_wait_access_leaf ,
224
- " .* Attempting to wait on monitor monitor_rank_access/1 while holding lock monitor_rank_tty/.*"
223
+ TEST_VM_ASSERT_MSG (MutexRank, monitor_wait_event_tty ,
224
+ " .* Attempting to wait on monitor monitor_rank_event/0 while holding lock monitor_rank_tty/.*"
225
225
" -- possible deadlock. Should not block\\ (wait\\ ) while holding a lock of rank special." ) {
226
226
JavaThread* THREAD = JavaThread::current ();
227
227
ThreadInVMfromNative invm (THREAD);
228
228
229
229
Monitor* monitor_rank_tty = new Monitor (Mutex::tty, " monitor_rank_tty" , false , Mutex::_safepoint_check_never);
230
- Monitor* monitor_rank_access = new Monitor (Mutex::access , " monitor_rank_access " , false , Mutex::_safepoint_check_never);
230
+ Monitor* monitor_rank_event = new Monitor (Mutex::event , " monitor_rank_event " , false , Mutex::_safepoint_check_never);
231
231
232
232
monitor_rank_tty->lock_without_safepoint_check ();
233
- monitor_rank_access ->lock_without_safepoint_check ();
234
- monitor_rank_access ->wait_without_safepoint_check (1 );
235
- monitor_rank_access ->unlock ();
233
+ monitor_rank_event ->lock_without_safepoint_check ();
234
+ monitor_rank_event ->wait_without_safepoint_check (1 );
235
+ monitor_rank_event ->unlock ();
236
236
monitor_rank_tty->unlock ();
237
237
}
238
238
@@ -251,4 +251,14 @@ TEST_VM_ASSERT_MSG(MutexRank, monitor_wait_tty_special,
251
251
monitor_rank_tty->unlock ();
252
252
monitor_rank_special->unlock ();
253
253
}
254
+
255
+ TEST_VM_ASSERT_MSG (MutexRank, monitor_negative_rank,
256
+ " .*Bad lock rank" ) {
257
+ JavaThread* THREAD = JavaThread::current ();
258
+ ThreadInVMfromNative invm (THREAD);
259
+
260
+ Monitor* monitor_rank_broken = new Monitor (Mutex::event-1 , " monitor_rank_broken" , false , Mutex::_safepoint_check_never);
261
+ monitor_rank_broken->lock_without_safepoint_check ();
262
+ monitor_rank_broken->unlock ();
263
+ }
254
264
#endif // ASSERT
0 commit comments