Make thread safe configurable