Fork自 PaddlePaddle / Paddle
In multi-thread condition, EnableProfiler can be called after RecordEvent is constructed. In this case, RecordEvent constructor will not init anything, but RecordEvent destructor will do something since EnableProfiler was called. This PR fixes it.