67 const auto deadline = std::chrono::steady_clock::now() + aTimeout;
72 std::vector<ENTRY> pending;
75 std::lock_guard<std::mutex> lock(
m_mutex );
82 for(
ENTRY& entry : pending )
84 std::shared_ptr<SHARED_STATE> state = entry.m_state;
86 std::unique_lock<std::mutex> doneLock( state->m_doneMutex );
88 bool finished = state->m_doneCv.wait_until( doneLock, deadline,
91 return state->m_done.load(
92 std::memory_order_acquire );
99 if( entry.m_thread.joinable() )
100 entry.m_thread.join();
105 "Orphan git thread [%s] did not finish in time; detaching",
106 entry.m_label.c_str() );
108 if( entry.m_thread.joinable() )
109 entry.m_thread.detach();