Questions arising from the Reading of muduo Source Code

recently I have been learning the source code of muduo, and I see a method in the Thread class

void runInThread()
  {
    *tid_ = muduo::CurrentThread::tid();
    tid_ = NULL;
    latch_->countDown();
    latch_ = NULL;
    
  }

I would like to ask, why did you just pass the calculated tid value to the * tid_ pointer and set tid_ to NULL? Are there any programming skills here? I don"t understand this part, so I"d like to consult my predecessors.

C cPP
Feb.21,2022

maybe it just wants to assign a value to * tid_ , and the use of this value may not be in this function.

and to avoid the subsequent operation of tid_ to change the value just assigned, so set it to NULL .

Menu