Utility for creating a DynamicTask that will wait for some condition and finish when the condition is true.