23 #include "pedigree/kernel/Atomic.h" 24 #include "pedigree/kernel/Spinlock.h" 25 #include "pedigree/kernel/compiler.h" 26 #include "pedigree/kernel/process/Event.h" 27 #include "pedigree/kernel/processor/types.h" 28 #include "pedigree/kernel/utilities/List.h" 29 #include "pedigree/kernel/utilities/Result.h" 30 #include "pedigree/kernel/utilities/new" 48 Semaphore(
size_t nInitialValue,
bool canInterrupt =
true);
58 SemaphoreResult acquireWithResult(
59 size_t n = 1,
size_t timeoutSecs = 0,
size_t timeoutUsecs = 0);
62 bool acquire(
size_t n = 1,
size_t timeoutSecs = 0,
size_t timeoutUsecs = 0)
64 SemaphoreResult result =
65 acquireWithResult(n, timeoutSecs, timeoutUsecs);
66 if (result.hasValue())
68 return result.value();
79 bool tryAcquire(
size_t n = 1);
83 void release(
size_t n = 1);
97 void removeThread(
class Thread *pThread);
106 virtual size_t serialize(uint8_t *pBuffer);
108 virtual size_t getNumber();
116 bool m_bCanInterrupt;
bool acquire(size_t n=1, size_t timeoutSecs=0, size_t timeoutUsecs=0)