function static variable destructor and thread

后端 未结 1 1021
灰色年华
灰色年华 2020-12-31 21:51

I have the a simple program.

int main() 
{
    std::atomic b = true;
    ConcurrentQueue queue;

    std::thread thread( [&         


        
相关标签:
1条回答
  • 2020-12-31 21:56

    There recently was a thread with the same problem, but I can't find it anymore.

    Basically, there's a deadlock in VS's runtime library when you have a static lifetime object that tries to end a thread in its destructor.

    0 讨论(0)
提交回复
热议问题