mirror of
https://github.com/tribes2/engine.git
synced 2026-01-19 19:24:45 +00:00
27 lines
825 B
C
27 lines
825 B
C
//-----------------------------------------------------------------------------
|
|
// V12 Engine
|
|
//
|
|
// Copyright (c) 2001 GarageGames.Com
|
|
// Portions Copyright (c) 2001 by Sierra Online, Inc.
|
|
//-----------------------------------------------------------------------------
|
|
|
|
#ifndef _PLATFORMSEMAPHORE_H_
|
|
#define _PLATFORMSEMAPHORE_H_
|
|
|
|
#ifndef _TYPES_H_
|
|
#include "Platform/types.h"
|
|
#endif
|
|
|
|
struct Semaphore
|
|
{
|
|
static void * createSemaphore(U32 initialCount = 1);
|
|
static void destroySemaphore(void * semaphore);
|
|
static bool acquireSemaphore(void * semaphore, bool block = true);
|
|
static void releaseSemaphore(void * semaphore);
|
|
|
|
inline static bool P(void * semaphore, bool block = true) {return(acquireSemaphore(semaphore, block));}
|
|
inline static void V(void * semaphore) {releaseSemaphore(semaphore);}
|
|
};
|
|
|
|
#endif
|