当我编译并运行下面的代码时,当我加入线程时,线程似乎会释放,然后当它得到未引用时,一些已经空闲的内存就会被读取。}
==2697== at 0x50F2350: g_thread_unref (in /lib/x86_64-linux-gnublock of size 72 free'd
==2697== at 0x4C2B60C:
linux手册中对pthread_join的介绍是:The pthread_join() function waits for the thread specified by thread to terminateParent thread: 99
结果总是在子线程结束后,主线程后面的for循环将被执行。这是否意味着pthread_join执行子线程,阻塞主线程,并在子线程结束时执行主线程?但是,当我删除以下代码的