Skip to content

Commit

Permalink
fix: mark 'currentTask' volatile as it is modified from multiple threads
Browse files Browse the repository at this point in the history
  • Loading branch information
Z-Kris committed Oct 20, 2024
1 parent 8ed0ffd commit 2d547a4
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import kotlin.time.TimeSource
public class GamePackProvider {
private var lastFetchTime = TimeSource.Monotonic.markNow()
private var lastPayload: ByteArray? = null

@Volatile
private var currentTask: ForkJoinTask<*>? = null

internal fun prefetch(await: Boolean = false) {
Expand Down

0 comments on commit 2d547a4

Please sign in to comment.