Closed
Description
Rule 3.5 says that Subscription.cancel() MUST be thread-safe.
Why is this so, given that rule 2.7 excludes the possibility of Subscription.cancel() being invoked concurrently? Why isn't it sufficient if the fact of cancellation is guaranteed to be visible to any subsequent calls on the Subscription?
For example, say I have something like the following:
volatile boolean cancelled = false;
public void cancel() {
myHashMap.put("hello", "world");
cancelled = true;
}
Why isn't this allowed?
Metadata
Metadata
Assignees
Labels
No labels