Replaced manual mutex usage with lock_guard and unique_lock
Changed worker threads to passively wait