[orbis-kernel] Make evf IPC-safe

This commit is contained in:
Ivan Chikish 2023-07-20 15:10:38 +03:00
parent 72185f0086
commit 1bf88f6fe8
4 changed files with 29 additions and 39 deletions

View file

@ -32,9 +32,6 @@ struct EventFlag final {
struct WaitingThread {
Thread *thread;
utils::shared_cv *cv;
std::uint64_t *patternSet;
bool *isCanceled;
std::uint64_t bitPattern;
std::uint8_t waitMode;
@ -70,10 +67,9 @@ struct EventFlag final {
: attrs(attrs), value(initPattern) {}
ErrorCode wait(Thread *thread, std::uint8_t waitMode,
std::uint64_t bitPattern, std::uint64_t *patternSet,
std::uint32_t *timeout);
std::uint64_t bitPattern, std::uint32_t *timeout);
ErrorCode tryWait(Thread *thread, std::uint8_t waitMode,
std::uint64_t bitPattern, std::uint64_t *patternSet);
std::uint64_t bitPattern);
std::size_t notify(NotifyType type, std::uint64_t bits);
std::size_t destroy() { return notify(NotifyType::Destroy, {}); }

View file

@ -4,13 +4,15 @@
#include "orbis-config.hpp"
#include "types.hpp"
#include "../utils/SharedCV.hpp"
#include "../utils/SharedMutex.hpp"
#include <thread>
namespace orbis {
struct Process;
struct Thread {
shared_mutex mtx;
utils::shared_mutex mtx;
utils::shared_cv sync_cv;
Process *tproc = nullptr;
uint64_t retval[2]{};
void *context{};