mirror of
https://github.com/PaperMC/Folia.git
synced 2024-11-21 11:55:11 +01:00
7595ff6bb2
It must be marked as completed during that lock hold since the waiters field is set to null. Thus, any other thread attempting a cancellation will fail to remove from waiters. Also, any other thread attempting to cancel may set the completed field to true which would cause accept() to fail as well. Completion was always designed to happen while holding the scheduling lock to prevent these race conditions. The code was originally set up to complete while not holding the scheduling lock to avoid invoking callbacks while holding the lock, however the access to the completion field was not considered. Resolve this by marking the callback as completed during the lock, but invoking the accept() function after releasing the lock. This will prevent any cancellation attempts to be blocked, and allow the current thread to complete the callback without any issues. |
||
---|---|---|
.. | ||
api | ||
server |