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 @@ -879,14 +879,11 @@ struct LLVMCodeGenThreads {
879
879
#ifdef __APPLE__
880
880
pthread_t threadId;
881
881
#else
882
- std::thread * thread;
882
+ std::thread thread;
883
883
#endif
884
884
885
885
Thread (LLVMCodeGenThreads &parent, unsigned threadIndex)
886
886
: parent(parent), threadIndex(threadIndex)
887
- #ifndef __APPLE__
888
- , thread(nullptr )
889
- #endif
890
887
{}
891
888
892
889
// / Run llvm codegen.
@@ -950,7 +947,7 @@ struct LLVMCodeGenThreads {
950
947
pthread_attr_destroy (&stackSizeAttribute);
951
948
#else
952
949
for (auto &thread : threads) {
953
- thread.thread = new std::thread (runThread, &thread);
950
+ thread.thread = std::thread (runThread, &thread);
954
951
}
955
952
#endif
956
953
@@ -967,8 +964,7 @@ struct LLVMCodeGenThreads {
967
964
pthread_join (thread.threadId , 0 );
968
965
#else
969
966
for (auto &thread: threads) {
970
- thread.thread ->join ();
971
- delete thread.thread ;
967
+ thread.thread .join ();
972
968
}
973
969
#endif
974
970
}
You can’t perform that action at this time.
0 commit comments