2020-01-18 11:38:21 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
|
|
* list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
|
|
* and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
|
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2020-07-03 14:19:50 +03:00
|
|
|
#include <AK/TemporaryChange.h>
|
2020-02-16 03:27:42 +03:00
|
|
|
#include <Kernel/KSyms.h>
|
2019-07-29 13:00:14 +03:00
|
|
|
#include <Kernel/Lock.h>
|
2020-12-15 02:36:22 +03:00
|
|
|
#include <Kernel/Thread.h>
|
|
|
|
|
|
|
|
//#define LOCK_TRACE_DEBUG
|
|
|
|
//#define LOCK_RESTORE_DEBUG
|
2019-07-29 13:00:14 +03:00
|
|
|
|
2020-02-16 03:27:42 +03:00
|
|
|
namespace Kernel {
|
|
|
|
|
2020-12-01 05:04:36 +03:00
|
|
|
#ifdef LOCK_DEBUG
|
|
|
|
void Lock::lock(Mode mode)
|
2019-07-29 13:00:14 +03:00
|
|
|
{
|
2020-12-01 05:04:36 +03:00
|
|
|
lock("unknown", 0, mode);
|
2020-04-18 12:21:00 +03:00
|
|
|
}
|
|
|
|
|
2020-12-01 05:04:36 +03:00
|
|
|
void Lock::lock(const char* file, int line, Mode mode)
|
|
|
|
#else
|
2020-04-18 12:21:00 +03:00
|
|
|
void Lock::lock(Mode mode)
|
2020-12-01 05:04:36 +03:00
|
|
|
#endif
|
2020-04-18 12:21:00 +03:00
|
|
|
{
|
2020-12-01 05:04:36 +03:00
|
|
|
// NOTE: This may be called from an interrupt handler (not an IRQ handler)
|
|
|
|
// and also from within critical sections!
|
|
|
|
ASSERT(!Processor::current().in_irq());
|
2020-04-18 12:21:00 +03:00
|
|
|
ASSERT(mode != Mode::Unlocked);
|
2020-06-29 00:34:31 +03:00
|
|
|
auto current_thread = Thread::current();
|
2020-12-15 02:36:22 +03:00
|
|
|
ScopedCritical critical; // in case we're not in a critical section already
|
2019-07-29 13:00:14 +03:00
|
|
|
for (;;) {
|
2020-10-29 05:03:15 +03:00
|
|
|
if (m_lock.exchange(true, AK::memory_order_acq_rel) == false) {
|
2020-07-06 00:46:51 +03:00
|
|
|
do {
|
|
|
|
// FIXME: Do not add new readers if writers are queued.
|
2020-12-15 02:36:22 +03:00
|
|
|
auto current_mode = m_mode.load(AK::MemoryOrder::memory_order_relaxed);
|
|
|
|
switch (current_mode) {
|
|
|
|
case Mode::Unlocked: {
|
|
|
|
#ifdef LOCK_TRACE_DEBUG
|
|
|
|
dbg() << "Lock::lock @ " << this << ": acquire " << mode_to_string(mode) << ", currently unlocked";
|
|
|
|
#endif
|
|
|
|
m_mode.store(mode, AK::MemoryOrder::memory_order_relaxed);
|
|
|
|
ASSERT(!m_holder);
|
|
|
|
ASSERT(m_shared_holders.is_empty());
|
|
|
|
if (mode == Mode::Exclusive) {
|
|
|
|
m_holder = current_thread;
|
|
|
|
} else {
|
|
|
|
ASSERT(mode == Mode::Shared);
|
|
|
|
m_shared_holders.set(current_thread, 1);
|
2020-12-01 05:04:36 +03:00
|
|
|
}
|
2020-12-15 02:36:22 +03:00
|
|
|
ASSERT(m_times_locked == 0);
|
|
|
|
m_times_locked++;
|
|
|
|
#ifdef LOCK_DEBUG
|
|
|
|
current_thread->holding_lock(*this, 1, file, line);
|
|
|
|
#endif
|
|
|
|
m_lock.store(false, AK::memory_order_release);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
case Mode::Exclusive: {
|
|
|
|
ASSERT(m_holder);
|
|
|
|
if (m_holder != current_thread)
|
|
|
|
break;
|
|
|
|
ASSERT(m_shared_holders.is_empty());
|
|
|
|
#ifdef LOCK_TRACE_DEBUG
|
|
|
|
if (mode == Mode::Exclusive)
|
|
|
|
dbg() << "Lock::lock @ " << this << ": acquire " << mode_to_string(mode) << ", currently exclusive, holding: " << m_times_locked;
|
|
|
|
else
|
|
|
|
dbg() << "Lock::lock @ " << this << ": acquire exclusive (requested " << mode_to_string(mode) << "), currently exclusive, holding " << m_times_locked;
|
|
|
|
#endif
|
|
|
|
ASSERT(mode == Mode::Exclusive || mode == Mode::Shared);
|
|
|
|
ASSERT(m_times_locked > 0);
|
|
|
|
m_times_locked++;
|
2020-12-01 05:04:36 +03:00
|
|
|
#ifdef LOCK_DEBUG
|
2020-12-15 02:36:22 +03:00
|
|
|
current_thread->holding_lock(*this, 1, file, line);
|
|
|
|
#endif
|
|
|
|
m_lock.store(false, AK::memory_order_release);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
case Mode::Shared: {
|
|
|
|
ASSERT(!m_holder);
|
|
|
|
if (mode != Mode::Shared)
|
|
|
|
break;
|
|
|
|
#ifdef LOCK_TRACE_DEBUG
|
|
|
|
dbg() << "Lock::lock @ " << this << ": acquire " << mode_to_string(mode) << ", currently shared, locks held: " << m_times_locked;
|
2020-12-01 05:04:36 +03:00
|
|
|
#endif
|
2020-12-15 02:36:22 +03:00
|
|
|
ASSERT(m_times_locked > 0);
|
2020-07-06 00:46:51 +03:00
|
|
|
m_times_locked++;
|
2020-12-15 02:36:22 +03:00
|
|
|
ASSERT(!m_shared_holders.is_empty());
|
|
|
|
auto it = m_shared_holders.find(current_thread);
|
|
|
|
if (it != m_shared_holders.end())
|
|
|
|
it->value++;
|
|
|
|
else
|
|
|
|
m_shared_holders.set(current_thread, 1);
|
|
|
|
#ifdef LOCK_DEBUG
|
|
|
|
current_thread->holding_lock(*this, 1, file, line);
|
|
|
|
#endif
|
2020-07-06 00:46:51 +03:00
|
|
|
m_lock.store(false, AK::memory_order_release);
|
|
|
|
return;
|
|
|
|
}
|
2020-12-15 02:36:22 +03:00
|
|
|
default:
|
|
|
|
ASSERT_NOT_REACHED();
|
|
|
|
}
|
2020-12-08 07:29:41 +03:00
|
|
|
m_lock.store(false, AK::memory_order_release);
|
|
|
|
} while (m_queue.wait_on(nullptr, m_name) == Thread::BlockResult::NotBlocked);
|
2020-10-27 01:48:51 +03:00
|
|
|
} else {
|
2020-12-01 05:04:36 +03:00
|
|
|
// I don't know *who* is using "m_lock", so just yield.
|
|
|
|
Scheduler::yield_from_critical();
|
2019-07-29 13:00:14 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Lock::unlock()
|
|
|
|
{
|
2020-12-01 05:04:36 +03:00
|
|
|
// NOTE: This may be called from an interrupt handler (not an IRQ handler)
|
|
|
|
// and also from within critical sections!
|
|
|
|
ASSERT(!Processor::current().in_irq());
|
2020-06-29 00:34:31 +03:00
|
|
|
auto current_thread = Thread::current();
|
2020-12-15 02:36:22 +03:00
|
|
|
ScopedCritical critical; // in case we're not in a critical section already
|
2019-07-29 13:00:14 +03:00
|
|
|
for (;;) {
|
2020-10-29 05:03:15 +03:00
|
|
|
if (m_lock.exchange(true, AK::memory_order_acq_rel) == false) {
|
2020-12-15 02:36:22 +03:00
|
|
|
auto current_mode = m_mode.load(AK::MemoryOrder::memory_order_relaxed);
|
|
|
|
#ifdef LOCK_TRACE_DEBUG
|
|
|
|
if (current_mode == Mode::Shared)
|
|
|
|
dbg() << "Lock::unlock @ " << this << ": release " << mode_to_string(current_mode) << ", locks held: " << m_times_locked;
|
|
|
|
else
|
|
|
|
dbg() << "Lock::unlock @ " << this << ": release " << mode_to_string(current_mode) << ", holding: " << m_times_locked;
|
|
|
|
#endif
|
|
|
|
ASSERT(current_mode != Mode::Unlocked);
|
2020-04-18 12:21:00 +03:00
|
|
|
|
2020-12-15 02:36:22 +03:00
|
|
|
ASSERT(m_times_locked > 0);
|
|
|
|
m_times_locked--;
|
2020-12-01 05:04:36 +03:00
|
|
|
|
2020-12-15 02:36:22 +03:00
|
|
|
switch (current_mode) {
|
|
|
|
case Mode::Exclusive:
|
2020-06-29 00:34:31 +03:00
|
|
|
ASSERT(m_holder == current_thread);
|
2020-12-15 02:36:22 +03:00
|
|
|
ASSERT(m_shared_holders.is_empty());
|
2020-12-01 05:04:36 +03:00
|
|
|
if (m_times_locked == 0)
|
|
|
|
m_holder = nullptr;
|
2020-12-15 02:36:22 +03:00
|
|
|
break;
|
|
|
|
case Mode::Shared: {
|
|
|
|
ASSERT(!m_holder);
|
|
|
|
auto it = m_shared_holders.find(current_thread);
|
|
|
|
ASSERT(it != m_shared_holders.end());
|
|
|
|
if (it->value > 1) {
|
|
|
|
it->value--;
|
|
|
|
} else {
|
|
|
|
ASSERT(it->value > 0);
|
|
|
|
m_shared_holders.remove(it);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
ASSERT_NOT_REACHED();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_times_locked == 0) {
|
|
|
|
ASSERT(current_mode == Mode::Exclusive ? !m_holder : m_shared_holders.is_empty());
|
|
|
|
m_mode.store(Mode::Unlocked, AK::MemoryOrder::memory_order_relaxed);
|
2020-12-01 05:04:36 +03:00
|
|
|
}
|
2020-12-15 02:36:22 +03:00
|
|
|
|
2020-12-01 05:04:36 +03:00
|
|
|
#ifdef LOCK_DEBUG
|
2020-12-15 02:36:22 +03:00
|
|
|
current_thread->holding_lock(*this, -1);
|
2020-12-01 05:04:36 +03:00
|
|
|
#endif
|
2020-04-18 12:21:00 +03:00
|
|
|
|
2020-12-08 07:29:41 +03:00
|
|
|
m_lock.store(false, AK::memory_order_release);
|
|
|
|
m_queue.wake_one();
|
2019-07-29 13:00:14 +03:00
|
|
|
return;
|
|
|
|
}
|
2019-12-01 13:57:20 +03:00
|
|
|
// I don't know *who* is using "m_lock", so just yield.
|
2020-12-01 05:04:36 +03:00
|
|
|
Scheduler::yield_from_critical();
|
2019-07-29 13:00:14 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-15 02:36:22 +03:00
|
|
|
auto Lock::force_unlock_if_locked(u32& lock_count_to_restore) -> Mode
|
2019-07-29 13:00:14 +03:00
|
|
|
{
|
2020-12-01 05:04:36 +03:00
|
|
|
// NOTE: This may be called from an interrupt handler (not an IRQ handler)
|
|
|
|
// and also from within critical sections!
|
|
|
|
ASSERT(!Processor::current().in_irq());
|
2020-12-15 02:36:22 +03:00
|
|
|
auto current_thread = Thread::current();
|
|
|
|
ScopedCritical critical; // in case we're not in a critical section already
|
2020-12-01 05:04:36 +03:00
|
|
|
for (;;) {
|
|
|
|
if (m_lock.exchange(true, AK::memory_order_acq_rel) == false) {
|
2020-12-15 02:36:22 +03:00
|
|
|
Mode previous_mode;
|
|
|
|
auto current_mode = m_mode.load(AK::MemoryOrder::memory_order_relaxed);
|
|
|
|
switch (current_mode) {
|
|
|
|
case Mode::Exclusive: {
|
|
|
|
if (m_holder != current_thread) {
|
|
|
|
m_lock.store(false, AK::MemoryOrder::memory_order_release);
|
|
|
|
lock_count_to_restore = 0;
|
|
|
|
return Mode::Unlocked;
|
|
|
|
}
|
|
|
|
#ifdef LOCK_RESTORE_DEBUG
|
|
|
|
dbg() << "Lock::force_unlock_if_locked @ " << this << ": unlocking exclusive with lock count: " << m_times_locked;
|
|
|
|
#endif
|
|
|
|
m_holder = nullptr;
|
|
|
|
ASSERT(m_times_locked > 0);
|
|
|
|
lock_count_to_restore = m_times_locked;
|
|
|
|
m_times_locked = 0;
|
|
|
|
m_mode.store(Mode::Unlocked, AK::MemoryOrder::memory_order_relaxed);
|
|
|
|
m_lock.store(false, AK::memory_order_release);
|
|
|
|
#ifdef LOCK_DEBUG
|
|
|
|
m_holder->holding_lock(*this, -(int)lock_count_to_restore);
|
|
|
|
#endif
|
|
|
|
previous_mode = Mode::Exclusive;
|
|
|
|
break;
|
2020-12-01 05:04:36 +03:00
|
|
|
}
|
2020-12-15 02:36:22 +03:00
|
|
|
case Mode::Shared: {
|
|
|
|
ASSERT(!m_holder);
|
|
|
|
auto it = m_shared_holders.find(current_thread);
|
|
|
|
if (it == m_shared_holders.end()) {
|
|
|
|
m_lock.store(false, AK::MemoryOrder::memory_order_release);
|
|
|
|
lock_count_to_restore = 0;
|
|
|
|
return Mode::Unlocked;
|
|
|
|
}
|
|
|
|
#ifdef LOCK_RESTORE_DEBUG
|
|
|
|
dbg() << "Lock::force_unlock_if_locked @ " << this << ": unlocking exclusive with lock count: " << it->value << ", total locks: " << m_times_locked;
|
|
|
|
#endif
|
|
|
|
ASSERT(it->value > 0);
|
|
|
|
lock_count_to_restore = it->value;
|
|
|
|
ASSERT(lock_count_to_restore > 0);
|
2020-12-01 05:04:36 +03:00
|
|
|
#ifdef LOCK_DEBUG
|
2020-12-15 02:36:22 +03:00
|
|
|
m_holder->holding_lock(*this, -(int)lock_count_to_restore);
|
2020-12-01 05:04:36 +03:00
|
|
|
#endif
|
2020-12-15 02:36:22 +03:00
|
|
|
m_shared_holders.remove(it);
|
|
|
|
ASSERT(m_times_locked >= lock_count_to_restore);
|
|
|
|
m_times_locked -= lock_count_to_restore;
|
|
|
|
if (m_times_locked == 0)
|
|
|
|
m_mode.store(Mode::Unlocked, AK::MemoryOrder::memory_order_relaxed);
|
|
|
|
m_lock.store(false, AK::memory_order_release);
|
|
|
|
previous_mode = Mode::Shared;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case Mode::Unlocked: {
|
|
|
|
m_lock.store(false, AK::memory_order_relaxed);
|
|
|
|
lock_count_to_restore = 0;
|
|
|
|
previous_mode = Mode::Unlocked;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
ASSERT_NOT_REACHED();
|
|
|
|
}
|
2020-12-08 07:29:41 +03:00
|
|
|
m_queue.wake_one();
|
2020-12-15 02:36:22 +03:00
|
|
|
return previous_mode;
|
|
|
|
}
|
|
|
|
// I don't know *who* is using "m_lock", so just yield.
|
|
|
|
Scheduler::yield_from_critical();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef LOCK_DEBUG
|
|
|
|
void Lock::restore_lock(Mode mode, u32 lock_count)
|
|
|
|
{
|
|
|
|
return restore_lock("unknown", 0, mode, lock_count);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Lock::restore_lock(const char* file, int line, Mode mode, u32 lock_count)
|
|
|
|
#else
|
|
|
|
void Lock::restore_lock(Mode mode, u32 lock_count)
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
ASSERT(mode != Mode::Unlocked);
|
|
|
|
ASSERT(lock_count > 0);
|
|
|
|
ASSERT(!Processor::current().in_irq());
|
|
|
|
auto current_thread = Thread::current();
|
|
|
|
ScopedCritical critical; // in case we're not in a critical section already
|
|
|
|
for (;;) {
|
|
|
|
if (m_lock.exchange(true, AK::memory_order_acq_rel) == false) {
|
|
|
|
switch (mode) {
|
|
|
|
case Mode::Exclusive: {
|
|
|
|
auto expected_mode = Mode::Unlocked;
|
|
|
|
if (!m_mode.compare_exchange_strong(expected_mode, Mode::Exclusive, AK::MemoryOrder::memory_order_relaxed))
|
|
|
|
break;
|
|
|
|
#ifdef LOCK_RESTORE_DEBUG
|
|
|
|
dbg() << "Lock::restore_lock @ " << this << ": restoring " << mode_to_string(mode) << " with lock count " << lock_count << ", was unlocked";
|
|
|
|
#endif
|
|
|
|
ASSERT(m_times_locked == 0);
|
|
|
|
m_times_locked = lock_count;
|
|
|
|
ASSERT(!m_holder);
|
|
|
|
ASSERT(m_shared_holders.is_empty());
|
|
|
|
m_holder = current_thread;
|
|
|
|
m_lock.store(false, AK::memory_order_release);
|
|
|
|
#ifdef LOCK_DEBUG
|
|
|
|
m_holder->holding_lock(*this, (int)lock_count, file, line);
|
|
|
|
#endif
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
case Mode::Shared: {
|
|
|
|
auto expected_mode = Mode::Unlocked;
|
|
|
|
if (!m_mode.compare_exchange_strong(expected_mode, Mode::Shared, AK::MemoryOrder::memory_order_relaxed) && expected_mode != Mode::Shared)
|
|
|
|
break;
|
|
|
|
#ifdef LOCK_RESTORE_DEBUG
|
|
|
|
dbg() << "Lock::restore_lock @ " << this << ": restoring " << mode_to_string(mode) << " with lock count " << lock_count << ", was " << mode_to_string(expected_mode);
|
|
|
|
#endif
|
|
|
|
ASSERT(expected_mode == Mode::Shared || m_times_locked == 0);
|
|
|
|
m_times_locked += lock_count;
|
|
|
|
ASSERT(!m_holder);
|
|
|
|
ASSERT((expected_mode == Mode::Unlocked) == m_shared_holders.is_empty());
|
|
|
|
auto set_result = m_shared_holders.set(current_thread, lock_count);
|
|
|
|
// There may be other shared lock holders already, but we should not have an entry yet
|
|
|
|
ASSERT(set_result == AK::HashSetResult::InsertedNewEntry);
|
|
|
|
m_lock.store(false, AK::memory_order_release);
|
|
|
|
#ifdef LOCK_DEBUG
|
|
|
|
m_holder->holding_lock(*this, (int)lock_count, file, line);
|
|
|
|
#endif
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
ASSERT_NOT_REACHED();
|
|
|
|
}
|
|
|
|
|
|
|
|
m_lock.store(false, AK::memory_order_relaxed);
|
2020-12-01 05:04:36 +03:00
|
|
|
}
|
|
|
|
// I don't know *who* is using "m_lock", so just yield.
|
|
|
|
Scheduler::yield_from_critical();
|
|
|
|
}
|
2019-07-29 13:00:14 +03:00
|
|
|
}
|
2020-02-16 03:27:42 +03:00
|
|
|
|
Kernel: Allow process with multiple threads to call exec and exit
This allows a process wich has more than 1 thread to call exec, even
from a thread. This kills all the other threads, but it won't wait for
them to finish, just makes sure that they are not in a running/runable
state.
In the case where a thread does exec, the new program PID will be the
thread TID, to keep the PID == TID in the new process.
This introduces a new function inside the Process class,
kill_threads_except_self which is called on exit() too (exit with
multiple threads wasn't properly working either).
Inside the Lock class, there is the need for a new function,
clear_waiters, which removes all the waiters from the
Process::big_lock. This is needed since after a exit/exec, there should
be no other threads waiting for this lock, the threads should be simply
killed. Only queued threads should wait for this lock at this point,
since blocked threads are handled in set_should_die.
2020-02-18 15:28:28 +03:00
|
|
|
void Lock::clear_waiters()
|
|
|
|
{
|
2020-12-15 02:36:22 +03:00
|
|
|
ASSERT(m_mode.load(AK::MemoryOrder::memory_order_relaxed) != Mode::Shared);
|
2020-12-08 07:29:41 +03:00
|
|
|
m_queue.wake_all();
|
Kernel: Allow process with multiple threads to call exec and exit
This allows a process wich has more than 1 thread to call exec, even
from a thread. This kills all the other threads, but it won't wait for
them to finish, just makes sure that they are not in a running/runable
state.
In the case where a thread does exec, the new program PID will be the
thread TID, to keep the PID == TID in the new process.
This introduces a new function inside the Process class,
kill_threads_except_self which is called on exit() too (exit with
multiple threads wasn't properly working either).
Inside the Lock class, there is the need for a new function,
clear_waiters, which removes all the waiters from the
Process::big_lock. This is needed since after a exit/exec, there should
be no other threads waiting for this lock, the threads should be simply
killed. Only queued threads should wait for this lock at this point,
since blocked threads are handled in set_should_die.
2020-02-18 15:28:28 +03:00
|
|
|
}
|
|
|
|
|
2020-02-16 03:27:42 +03:00
|
|
|
}
|