make allocator thread save