public class SyncTest extends Object
| Constructor and Description |
|---|
SyncTest() |
| Modifier and Type | Method and Description |
|---|---|
void |
testSync2_roundRobin()
Multiple 2-party syncs are used to coordinate control among three threads.
|
void |
testSync3Parties()
A single 3-party sync is used to coordinate control among three threads.
|
void |
testSyncRaces()
Multiple threads loop around the same sync with the party count equal to the number of threads.
|
void |
testSyncTimeout() |
public void testSync2_roundRobin()
throws Exception
syncXY, where X is the thread that is expected
to have control and Y is the thread that is receiving control. For example,
sync12 is only used by threads 1 and 2, never by thread 3. It is called by
thread 1 just after adding a number (meaning when it had control) and by thread 2
just before adding a number (meaning it is waiting for control). The numbers are
arranged such that the correct control flow results in counting from 1 to 10.Exceptionpublic void testSync3Parties()
public void testSyncRaces()
public void testSyncTimeout()
Copyright © 2017 Atlassian. All rights reserved.