fix for the deadlock; perf increase by notifying all threads and spinning longer until waiting for the conditional variable