[kernel] Add locking to endpoint

Endpoints could previously crash if two senders were concurrently
writing to them, so this change adds a spinlock and protects functions
that touch the signals and blocked list.
This commit is contained in:
Justin C. Miller
2022-01-23 19:42:37 -08:00
parent 0394f29f70
commit 3f8dfbd5b2
2 changed files with 18 additions and 0 deletions

View File

@@ -3,6 +3,7 @@
/// Definition of endpoint kobject types
#include <j6/signals.h>
#include <util/spinlock.h>
#include <util/vector.h>
#include "objects/kobject.h"
@@ -72,6 +73,7 @@ private:
j6_status_t do_message_copy(const thread_data &sender, thread_data &receiver);
util::spinlock m_lock;
util::vector<thread_data> m_blocked;
};