refactor: put mutex next to the things it protects
If we put the lock next to the fields it protects, it can sometimes make
it easier to reason about threadsafety.
In this case, it reveals that the task queue (not threadsafe) isn't protected by the
mutex, yet shared between the worker and callers.
@whyrusleeping
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
Showing
Please register or sign in to comment