lockAndWaitForResult
Exclusively runs the specified block then suspends until resumeIfSet is called and returns the value that was passed to that. Behavior is undefined if resumeIfSet was called when block returns false.
Exclusively runs the specified block then suspends until resumeIfSet is called and returns the value that was passed to that. Behavior is undefined if resumeIfSet was called when block returns false.