Rewrote RetryingTask to use AQS for synchronization