-
Bug
-
Resolution: Fixed
-
P3
-
None
-
repo-panama
A confined scope, even if it can only be acquired by the same thread as the owner thread, can still be released by different threads. This can happen in two cases:
1. the confined scope is acquired by another confined scope featuring implicit cleanup - in which case the cleaner thread will do the release
2. the confined scope is acquired, in the same thread, by a shared scope. Since a shared scope can be closed by any other thread, it follows that release can also be done by any thread.
In both cases, this can lead to a racy update of the lock count: there could be release vs. release races, but also acquire vs. release races too.
1. the confined scope is acquired by another confined scope featuring implicit cleanup - in which case the cleaner thread will do the release
2. the confined scope is acquired, in the same thread, by a shared scope. Since a shared scope can be closed by any other thread, it follows that release can also be done by any thread.
In both cases, this can lead to a racy update of the lock count: there could be release vs. release races, but also acquire vs. release races too.