Initial commit
This commit is contained in:
24
Torque/SDK/engine/platform/platformSemaphore.h
Normal file
24
Torque/SDK/engine/platform/platformSemaphore.h
Normal file
@@ -0,0 +1,24 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _PLATFORMSEMAPHORE_H_
|
||||
#define _PLATFORMSEMAPHORE_H_
|
||||
|
||||
#ifndef _TORQUE_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
|
||||
Reference in New Issue
Block a user