Coroutine primitive to wait for a variable to be set

is there a coroutine primitive which waits for a flag to be set?
I guess i could build one but wanted to know if there was already.

i was suggested to use a, CompletableDeferred.