mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 21:42:39 +00:00
Try abort on current thread join.
This commit is contained in:
parent
58f238007a
commit
ecc23867db
@ -237,6 +237,10 @@ public:
|
||||
if (!initialized())
|
||||
abort();
|
||||
|
||||
/// Thread cannot join itself.
|
||||
if (state->thread_id == std::this_thread::get_id())
|
||||
abort();
|
||||
|
||||
state->event.wait();
|
||||
state.reset();
|
||||
}
|
||||
@ -250,12 +254,7 @@ public:
|
||||
|
||||
bool joinable() const
|
||||
{
|
||||
if (!state)
|
||||
return false;
|
||||
/// Thread cannot join itself.
|
||||
if (state->thread_id == std::this_thread::get_id())
|
||||
return false;
|
||||
return true;
|
||||
return initialized();
|
||||
}
|
||||
|
||||
protected:
|
||||
|
Loading…
Reference in New Issue
Block a user