48 const auto deadline = std::chrono::steady_clock::now() + aTimeout;
53 std::vector<ENTRY> pending;
56 std::lock_guard<std::mutex> lock(
m_mutex );
63 for(
ENTRY& entry : pending )
65 std::shared_ptr<SHARED_STATE> state = entry.m_state;
67 std::unique_lock<std::mutex> doneLock( state->m_doneMutex );
69 bool finished = state->m_doneCv.wait_until( doneLock, deadline,
72 return state->m_done.load(
73 std::memory_order_acquire );
80 if( entry.m_thread.joinable() )
81 entry.m_thread.join();
86 "Orphan git thread [%s] did not finish in time; detaching",
87 entry.m_label.c_str() );
89 if( entry.m_thread.joinable() )
90 entry.m_thread.detach();