without an active exception

 Wed, 21-Jun-2023 08:52:06

 

void fuction()

{

 std::thread t1(server);
}

code above,  will occur that  terminate called without an active exception

 

to solve the problem,  modify code above as following code.

void fuction()

{

 std::thread t1(server);

t1.detach(); // or t1.join 
}