File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -880,14 +880,11 @@ struct LLVMCodeGenThreads {
880
880
#ifdef __APPLE__
881
881
pthread_t threadId;
882
882
#else
883
- std::thread * thread;
883
+ std::thread thread;
884
884
#endif
885
885
886
886
Thread (LLVMCodeGenThreads &parent, unsigned threadIndex)
887
887
: parent(parent), threadIndex(threadIndex)
888
- #ifndef __APPLE__
889
- , thread(nullptr )
890
- #endif
891
888
{}
892
889
893
890
// / Run llvm codegen.
@@ -951,7 +948,7 @@ struct LLVMCodeGenThreads {
951
948
pthread_attr_destroy (&stackSizeAttribute);
952
949
#else
953
950
for (auto &thread : threads) {
954
- thread.thread = new std::thread (runThread, &thread);
951
+ thread.thread = std::thread (runThread, &thread);
955
952
}
956
953
#endif
957
954
@@ -968,8 +965,7 @@ struct LLVMCodeGenThreads {
968
965
pthread_join (thread.threadId , 0 );
969
966
#else
970
967
for (auto &thread: threads) {
971
- thread.thread ->join ();
972
- delete thread.thread ;
968
+ thread.thread .join ();
973
969
}
974
970
#endif
975
971
}
You can’t perform that action at this time.
0 commit comments