File tree Expand file tree Collapse file tree
src/test/java/vanilla/java/affinity Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020import vanilla .java .affinity .impl .VanillaCpuLayout ;
2121
2222import java .io .IOException ;
23+ import java .util .ArrayList ;
24+ import java .util .List ;
2325
2426import static org .junit .Assert .assertEquals ;
2527import static org .junit .Assert .assertNotSame ;
@@ -142,4 +144,19 @@ public void testIssue21() {
142144 alForAnotherThread2 .release ();
143145 }
144146
147+ @ Test
148+ public void testIssue19 () {
149+ AffinityLock al = AffinityLock .acquireLock ();
150+ List <AffinityLock > locks = new ArrayList <AffinityLock >();
151+ locks .add (al );
152+ for (int i = 0 ; i < 256 ; i ++)
153+ locks .add (al = al .acquireLock (AffinityStrategies .DIFFERENT_SOCKET ,
154+ AffinityStrategies .DIFFERENT_CORE ,
155+ AffinityStrategies .SAME_SOCKET ,
156+ AffinityStrategies .ANY ));
157+ for (AffinityLock lock : locks ) {
158+ lock .release ();
159+ }
160+ }
161+
145162}
You can’t perform that action at this time.
0 commit comments