aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Kernel/KEvent.cs
blob: 1a865aa20206c614eab9c658441e460bb2abcdc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
namespace Ryujinx.HLE.HOS.Kernel
{
    class KEvent : KSynchronizationObject
    {
        private bool Signaled;

        public string Name { get; private set; }

        public KEvent(Horizon System, string Name = "") : base(System)
        {
            this.Name = Name;
        }

        public override void Signal()
        {
            System.CriticalSectionLock.Lock();

            if (!Signaled)
            {
                Signaled = true;

                base.Signal();
            }

            System.CriticalSectionLock.Unlock();
        }

        public void Reset()
        {
            Signaled = false;
        }

        public override bool IsSignaled()
        {
            return Signaled;
        }
    }
}