Fixed compile errors, added Semaphore code
[tpg/acess2.git] / Kernel / include / acess.h
index a27ebd6..1f969f8 100644 (file)
@@ -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

UCC git Repository :: git.ucc.asn.au