add code to make a worker wait and wake up

Link: https://github.com/GeneAssembly/biosal/issues/470
Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>