using reader-writer lock to protect job queue