63 const auto deadline = std::chrono::steady_clock::now() + aTimeout;
68 std::vector<ENTRY> pending;
71 std::lock_guard<std::mutex> lock(
m_mutex );
78 for(
ENTRY& entry : pending )
80 std::shared_ptr<SHARED_STATE> state = entry.m_state;
82 std::unique_lock<std::mutex> doneLock( state->m_doneMutex );
84 bool finished = state->m_doneCv.wait_until( doneLock, deadline,
87 return state->m_done.load(
88 std::memory_order_acquire );
95 if( entry.m_thread.joinable() )
96 entry.m_thread.join();
101 "Orphan git thread [%s] did not finish in time; detaching",
102 entry.m_label.c_str() );
104 if( entry.m_thread.joinable() )
105 entry.m_thread.detach();