typedef Sint64 tTimestamp;
typedef struct sShortSpinlock tShortSpinlock;
typedef struct sMutex tMutex;
-typedef struct sSemaphore tSemaphore;
struct sMutex {
tShortSpinlock Protector; //!< Protector for the lock strucure
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
* \brief Removed an active timer
*/
extern void Time_RemoveTimer(int ID);
+/**
+ * \brief Wait for a period of milliseconds
+ */
extern void Time_Delay(int Delay);
/**
* \}
extern int SpawnTask(tThreadFunction Function, void *Arg);
extern Uint *Threads_GetCfgPtr(int Id);
extern int Threads_SetName(const char *NewName);
-extern void Mutex_Acquire(tMutex *Mutex);
+extern int Mutex_Acquire(tMutex *Mutex);
extern void Mutex_Release(tMutex *Mutex);
extern int Mutex_IsLocked(tMutex *Mutex);
/**