Response waiter is now volatile, as it's data is used by DIFFERENT coroutines.

This commit is contained in:
Robinson 2022-06-11 22:36:23 +02:00
parent 542b678531
commit 3dd333269e
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C

View File

@ -27,10 +27,14 @@ data class ResponseWaiter(val id: Int) {
// "send" suspends until another coroutine invokes "receive". // "send" suspends until another coroutine invokes "receive".
// //
// these are wrapped in a try/catch, because cancel will cause exceptions to be thrown (which we DO NOT want) // these are wrapped in a try/catch, because cancel will cause exceptions to be thrown (which we DO NOT want)
@Volatile
var channel: Channel<Unit> = Channel(Channel.RENDEZVOUS) var channel: Channel<Unit> = Channel(Channel.RENDEZVOUS)
@Volatile
var isCancelled = false var isCancelled = false
// holds the RMI result or callback. This is ALWAYS accessed from within a lock (so no synchronize/volatile/etc necessary)! // holds the RMI result or callback. This is ALWAYS accessed from within a lock (so no synchronize/volatile/etc necessary)!
@Volatile
var result: Any? = null var result: Any? = null
/** /**