Because there's a number of panic points in the code, the aborted signal also should be set by a drop guard ensuring that the flag is set even on unwind so that no threads deadlock due to a panic in the worker thread.
The semaphore is acquired before checking if the worker channel is broken, so the semaphore can cause a deadlock if the worker exits, even without panicking.
Originally posted by @demosdemon in #1685 (comment)