refactor workers mutex lock