Skip to content

Commit 76dd958

Browse files
committed
Add @volatile to _jwtInvalidatedHandler for JMM visibility
The field is written from the main thread in IdentityVerificationService.start() and read on the OperationRepo coroutine thread. @volatile guarantees cross-thread visibility. Made-with: Cursor
1 parent e993fc0 commit 76dd958

File tree

1 file changed

+1
-0
lines changed
  • OneSignalSDK/onesignal/core/src/main/java/com/onesignal/core/internal/operations/impl

1 file changed

+1
-0
lines changed

OneSignalSDK/onesignal/core/src/main/java/com/onesignal/core/internal/operations/impl/OperationRepo.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ internal class OperationRepo(
4444
}
4545
}
4646

47+
@Volatile
4748
private var _jwtInvalidatedHandler: ((String) -> Unit)? = null
4849

4950
internal class LoopWaiterMessage(

0 commit comments

Comments
 (0)