Skip to content

Commit

Permalink
Fixup for the bug in atomicfu: in case of delegated "volatile" proper…
Browse files Browse the repository at this point in the history
…ties, atomicfu-compiler-plugin swaps the order of property initialization.
  • Loading branch information
mvicsokolova committed Apr 15, 2024
1 parent f105b44 commit fdaf524
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -51,7 +51,8 @@ public class CIOApplicationEngine(
private val startupJob: CompletableDeferred<Unit> = CompletableDeferred()
private val stopRequest: CompletableJob = Job()

private var serverJob: Job by atomic(Job())
// Compiler plugin swaps the order of initialization of atomic field
@Volatile private var serverJob: Job = Job()

init {
serverJob = initServerJob()
Expand Down

0 comments on commit fdaf524

Please sign in to comment.