meso: Implement KLightServerSession dtor

This commit is contained in:
TuxSH
2018-11-12 09:54:22 +01:00
committed by Michael Scire
parent 9c8f818c29
commit be3550d382
8 changed files with 60 additions and 10 deletions

View File

@@ -21,7 +21,6 @@ class KLightClientSession final : public KAutoObject, public IClient<KLightSessi
friend class KLightSession;
KClientPort *parentPort = nullptr;
bool isRemoteActive = false;
};
MESOSPHERE_AUTO_OBJECT_DEFINE_INCREF(LightClientSession);

View File

@@ -38,12 +38,13 @@ class KLightServerSession final :
virtual bool IsSignaled() const override;
private:
friend class KLightSession;
void Terminate(bool fromServer);
KThread::WaitList senderThreads{}, receiverThreads{};
SharedPtr<KThread> currentSender{}, currentReceiver{};
bool isRemoteActive = false;
SharedPtr<KThread> currentSender{};
KThread *currentReceiver = nullptr;
};
MESOSPHERE_AUTO_OBJECT_DEFINE_INCREF(LightServerSession);

View File

@@ -24,6 +24,14 @@ class KLightSession final :
virtual ~KLightSession();
Result Initialize();
private:
friend class KLightClientSession;
friend class KLightServerSession;
void Terminate(bool fromServer);
bool isClientAlive = false;
bool isServerAlive = false;
};
MESOSPHERE_AUTO_OBJECT_DEFINE_INCREF(LightSession);

View File

@@ -242,6 +242,14 @@ class KThread final :
void CancelKernelSync();
/// Takes effect immediately
void CancelKernelSync(Result res);
/// Needs to be in kernel sync
bool IsInKernelSync() const { return currentWaitList != nullptr; }
/// User sync
constexpr bool IsWaitingSync() const { return isWaitingSync; }
void SetWaitingSync(bool isWaitingSync) { this->isWaitingSync = isWaitingSync; }
constexpr bool IsSyncCancelled() const { return isSyncCancelled; }
void SetSyncCancelled(bool isSyncCancelled) { this->isSyncCancelled = isSyncCancelled; }
/// Takes effect when critical section is left
void HandleSyncObjectSignaled(KSynchronizationObject *syncObj);
@@ -295,7 +303,7 @@ private:
uint basePriority = 64, priority = 64;
int currentCoreId = -1;
ulong affinityMask = 0;
bool cancelled = false;
bool isSyncCancelled = false;
bool isWaitingSync = false;
uiptr wantedMutex = 0;
KThread *wantedMutexOwner = nullptr;