< prev index next >

test/hotspot/gtest/utilities/test_singleWriterSynchronizer.cpp

Print this page




 119   for (uint i = 0; i < nreaders; ++i) {
 120     readers[i] = new SingleWriterSynchronizerTestReader(&post,
 121                                                         &synchronizer,
 122                                                         &synchronized_value,
 123                                                         &continue_running);
 124     readers[i]->doit();
 125   }
 126 
 127   JavaTestThread* writer =
 128     new SingleWriterSynchronizerTestWriter(&post,
 129                                            &synchronizer,
 130                                            &synchronized_value,
 131                                            &continue_running);
 132 
 133   writer->doit();
 134 
 135   tty->print_cr("Stressing synchronizer for %u ms", milliseconds_to_run);
 136   JavaThread* cur = JavaThread::current();
 137   {
 138     ThreadInVMfromNative invm(cur);
 139     os::sleep(cur, milliseconds_to_run);
 140   }
 141   continue_running = 0;
 142   for (uint i = 0; i < nreaders + 1; ++i) {
 143     post.wait();
 144   }
 145 }


 119   for (uint i = 0; i < nreaders; ++i) {
 120     readers[i] = new SingleWriterSynchronizerTestReader(&post,
 121                                                         &synchronizer,
 122                                                         &synchronized_value,
 123                                                         &continue_running);
 124     readers[i]->doit();
 125   }
 126 
 127   JavaTestThread* writer =
 128     new SingleWriterSynchronizerTestWriter(&post,
 129                                            &synchronizer,
 130                                            &synchronized_value,
 131                                            &continue_running);
 132 
 133   writer->doit();
 134 
 135   tty->print_cr("Stressing synchronizer for %u ms", milliseconds_to_run);
 136   JavaThread* cur = JavaThread::current();
 137   {
 138     ThreadInVMfromNative invm(cur);
 139     cur->sleep(milliseconds_to_run);
 140   }
 141   continue_running = 0;
 142   for (uint i = 0; i < nreaders + 1; ++i) {
 143     post.wait();
 144   }
 145 }
< prev index next >