Skip to content

Commit d163988

Browse files
authored
Fix verbose builds: Reset thread ID _after_ flush_thread completes (#7152)
1 parent 763519a commit d163988

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/enclave/main.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,6 @@ extern "C"
177177

178178
e.store(enclave);
179179

180-
// Reset the thread ID generator. This function will exit before any
181-
// thread calls enclave_run, and without creating any new threads, so it
182-
// is safe for the first thread that calls enclave_run to re-use this
183-
// thread_id. That way they are both considered MAIN_THREAD_ID, even if
184-
// they are actually distinct std::threads.
185-
ccf::threading::reset_thread_id_generator();
186-
187180
return CreateNodeStatus::OK;
188181
}
189182

src/host/run.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,13 @@ namespace ccf
916916
ecall_completed.store(true);
917917
flusher_thread.join();
918918

919+
// Reset the thread ID generator. This function will exit before any
920+
// thread calls enclave_run, and without creating any new threads, so it
921+
// is safe for the first thread that calls enclave_run to re-use this
922+
// thread_id. That way they are both considered MAIN_THREAD_ID, even if
923+
// they are actually distinct std::threads.
924+
ccf::threading::reset_thread_id_generator();
925+
919926
if (create_status != CreateNodeStatus::OK)
920927
{
921928
LOG_FAIL_FMT(

0 commit comments

Comments
 (0)