X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Finclude%2Facess.h;h=1f969f8a2b128b3cce21285d2ce00a720b1d8373;hb=8c50e4a0672bdf9e9f6266fa5f485ad7f8b74f5b;hp=a27ebd61bfcbadcf69cfb9be2a9b64aa93535cf9;hpb=4fc7efa62f7a33e0c8a499f5a175419c2d16c273;p=tpg%2Facess2.git diff --git a/Kernel/include/acess.h b/Kernel/include/acess.h index a27ebd61..1f969f8a 100644 --- a/Kernel/include/acess.h +++ b/Kernel/include/acess.h @@ -22,14 +22,24 @@ typedef Uint tGID; typedef Sint64 tTimestamp; typedef struct sShortSpinlock tShortSpinlock; typedef struct sMutex tMutex; +typedef struct sSemaphore tSemaphore; struct sMutex { tShortSpinlock Protector; //!< Protector for the lock strucure + const char *Name; //!< Human-readable name struct sThread *volatile Owner; //!< Owner of the lock (set upon getting the lock) struct sThread *Waiting; //!< Waiting threads struct sThread *LastWaiting; //!< Waiting threads }; +struct sSemaphore { + tShortSpinlock Protector; //!< Protector for the lock strucure + const char *Name; //!< Human-readable name + volatile int Value; //!< Current mutex value + struct sThread *Waiting; //!< Waiting threads + struct sThread *LastWaiting; //!< Waiting threads +}; + // --- Helper Macros --- /** * \name Helper Macros