dart-mutex
dart-mutex copied to clipboard
Do mutexes work across isolates?
The documentation should be changed to answer this question.?
Ok, I'll consider adding a note about it in the next release.
But if you try to use a mutex across isolates, you should quickly realise it is impossible. The only way to communicate between isolates is to use the Isolate.send()
method that only sends messages, so there is no way to refer to the same mutex in two different isolates. And the isolates documentation says they are designed so you don't have to worry about mutexes or locks.