1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:27:35 +00:00

Kernel: Add a SpinLock to the WaitQueue

We need to be able to prevent a WaitQueue from being
modified by another CPU. So, add a SpinLock to it.

Because this pushes some other class over the 64 byte
limit, we also need to add another 128-byte bucket to
the slab allocator.
This commit is contained in:
Tom 2020-07-04 16:00:57 -06:00 committed by Andreas Kling
parent 788b2d64c6
commit 49f5069b76
3 changed files with 13 additions and 5 deletions

View file

@ -28,6 +28,7 @@
#include <AK/Atomic.h>
#include <AK/SinglyLinkedList.h>
#include <Kernel/SpinLock.h>
#include <Kernel/Thread.h>
namespace Kernel {
@ -46,6 +47,7 @@ public:
private:
typedef IntrusiveList<Thread, &Thread::m_wait_queue_node> ThreadList;
ThreadList m_threads;
SpinLock<u32> m_lock;
};
}