- Enclosing class:
- ReaderWriterLock
public static class ReaderWriterLock.Test
extends Object
The Test class is a unit test for the other code in the current file. Run
the test with: java com.holub.asynch.ReaderWriterLock\$Test
(the backslash isn't required with windows boxes), and don't include this
class file in your final distribution. The output could vary in trivial
ways, depending on system timing. The read/write order should be exactly
the same as in the following sample:
Starting w/0 w/0 writing Starting r/1 Starting w/1 Starting w/2 Starting
r/2 Starting r/3 w/0 done Stopping w/0 r/1 reading r/2 reading r/3
reading r/1 done Stopping r/1 r/2 done r/3 done Stopping r/2 Stopping r/3
w/1 writing w/1 done Stopping w/1 w/2 writing w/2 done Stopping w/2