Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure unmuted actors can't run on two schedulers concurrently
Prior to this commit, an actor with no pending messages being unmuted could end up running concurrently on two scheduler threads due to a race condition. The specific issue is that we `unmute the actor` and then we `schedule the actor`. It is entirely possible that the unmuted actor could get scheduled on a different scheduler thread if another actor sent it a message at the same time as we schedule it to run on the current scheduler thread. This commit changes the logic to check whether the actor has any pending messages or not prior to unmuting it and will only reschedule the actor if the actor actually had pending messages to process already waiting in its queue.
- Loading branch information