Second draft with synchronization where two BlockingQueues are used