Skip to content

Commit 7eb41ef

Browse files
committed
Fixed bug in LockFreeLinkedList (invariant & lock-freedom violation)
Migrated atomic ops to AtomicFU library for ease of code maintenance Implement lock-freedom testing in LockFreeLinkedListAtomicStressLFTest
1 parent ddcbdd3 commit 7eb41ef

File tree

5 files changed

+324
-248
lines changed

5 files changed

+324
-248
lines changed

kotlinx-coroutines-core/pom.xml

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,31 +47,90 @@
4747
<version>1.8.1</version>
4848
<scope>test</scope>
4949
</dependency>
50+
<dependency>
51+
<groupId>org.jetbrains.kotlinx</groupId>
52+
<artifactId>atomicfu</artifactId>
53+
<version>${atomicfu.version}</version>
54+
<scope>provided</scope>
55+
</dependency>
5056
</dependencies>
5157

5258
<build>
5359
<sourceDirectory>src/main/kotlin</sourceDirectory>
5460
<testSourceDirectory>src/test/kotlin</testSourceDirectory>
5561

56-
5762
<plugins>
63+
<!-- compile Kotlin files to staging directory -->
64+
<plugin>
65+
<groupId>org.jetbrains.kotlin</groupId>
66+
<artifactId>kotlin-maven-plugin</artifactId>
67+
<version>${kotlin.version}</version>
68+
<executions>
69+
<execution>
70+
<id>compile</id>
71+
<phase>compile</phase>
72+
<goals>
73+
<goal>compile</goal>
74+
</goals>
75+
<configuration>
76+
<output>${project.build.directory}/classes-atomicfu</output>
77+
</configuration>
78+
</execution>
79+
</executions>
80+
</plugin>
81+
<!-- transform classes with AtomicFU plugin -->
82+
<plugin>
83+
<groupId>org.jetbrains.kotlinx</groupId>
84+
<artifactId>atomicfu-maven-plugin</artifactId>
85+
<version>${atomicfu.version}</version>
86+
<executions>
87+
<execution>
88+
<goals>
89+
<goal>transform</goal>
90+
</goals>
91+
<configuration>
92+
<verbose>true</verbose>
93+
<input>${project.build.directory}/classes-atomicfu</input>
94+
</configuration>
95+
</execution>
96+
</executions>
97+
</plugin>
98+
<!-- additional configuration for tests -->
5899
<plugin>
59100
<artifactId>maven-surefire-plugin</artifactId>
60101
<executions>
61102
<!-- fork tests under jdk 1.6 as an additional execution -->
62103
<execution>
63104
<id>jdk16-test</id>
64105
<phase>test</phase>
65-
<goals><goal>test</goal></goals>
106+
<goals>
107+
<goal>test</goal>
108+
</goals>
66109
<configuration>
67110
<forkMode>once</forkMode>
68111
<jvm>${env.JDK_16}/bin/java</jvm>
69112
<argLine>-ea -Xmx1g -Xms1g -Djava.security.manager=kotlinx.coroutines.experimental.TestSecurityManager</argLine>
70113
<excludes>
71114
<exclude>**/*LinearizabilityTest.*</exclude>
115+
<exclude>**/*LFTest.java</exclude>
72116
</excludes>
73117
</configuration>
74118
</execution>
119+
<!-- test lock-freedom on un-processed files -->
120+
<execution>
121+
<id>lockfreedom-test</id>
122+
<phase>test</phase>
123+
<goals>
124+
<goal>test</goal>
125+
</goals>
126+
<configuration>
127+
<forkMode>once</forkMode>
128+
<classesDirectory>${project.build.directory}/classes-atomicfu</classesDirectory>
129+
<includes>
130+
<include>**/*LFTest.java</include>
131+
</includes>
132+
</configuration>
133+
</execution>
75134
</executions>
76135
</plugin>
77136
<plugin>

0 commit comments

Comments
 (0)