85 // Thread tries to lock it.
86 {
87 ObjectLocker ol(h_obj, THREAD);
88 assert_test_pattern(h_obj, "locked");
89 }
90 assert_test_pattern(h_obj, "is_unlocked no_hash");
91
92 // Hash the object then print it.
93 intx hash = h_obj->identity_hash();
94 assert_test_pattern(h_obj, "is_unlocked hash=0x");
95
96 // Wait gets the lock inflated.
97 {
98 ObjectLocker ol(h_obj, THREAD);
99
100 Semaphore done(0);
101 LockerThread* st;
102 st = new LockerThread(&done, h_obj());
103 st->doit();
104
105 ol.wait(THREAD);
106 assert_test_pattern(h_obj, "monitor");
107 done.wait_with_safepoint_check(THREAD); // wait till the thread is done.
108 }
109 }
110 #endif // PRODUCT
|
85 // Thread tries to lock it.
86 {
87 ObjectLocker ol(h_obj, THREAD);
88 assert_test_pattern(h_obj, "locked");
89 }
90 assert_test_pattern(h_obj, "is_unlocked no_hash");
91
92 // Hash the object then print it.
93 intx hash = h_obj->identity_hash();
94 assert_test_pattern(h_obj, "is_unlocked hash=0x");
95
96 // Wait gets the lock inflated.
97 {
98 ObjectLocker ol(h_obj, THREAD);
99
100 Semaphore done(0);
101 LockerThread* st;
102 st = new LockerThread(&done, h_obj());
103 st->doit();
104
105 ol.wait_uninterruptibly(THREAD);
106 assert_test_pattern(h_obj, "monitor");
107 done.wait_with_safepoint_check(THREAD); // wait till the thread is done.
108 }
109 }
110 #endif // PRODUCT
|