mirror of
https://github.com/Z3Prover/z3
synced 2025-04-08 18:31:49 +00:00
scoped_timer: wait for timer thread before main thread continues (#4803)
This commit is contained in:
parent
e16acd0965
commit
0fa88efc2b
|
@ -34,7 +34,7 @@ struct scoped_timer_state {
|
|||
std::timed_mutex m_mutex;
|
||||
event_handler * eh;
|
||||
unsigned ms;
|
||||
int work;
|
||||
std::atomic<int> work;
|
||||
std::condition_variable_any cv;
|
||||
};
|
||||
|
||||
|
@ -102,6 +102,8 @@ public:
|
|||
|
||||
~imp() {
|
||||
s->m_mutex.unlock();
|
||||
while (s->work == 1)
|
||||
std::this_thread::yield();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue