Make the multi-thread safe