updated to non-blocking mutex lock when creating new thread