Added a template for blocking on a variable to be set depending on interrupt handlers.