view Isolated/UNUSED/SimpleSemaphore.h @ 59:7d508c8cd75a

New implementation backend for SimpleThread using native Windows threading APIs. Documentation found here: http://msdn.microsoft.com/en-us/library/kdzttdcb(v=vs.110).aspx Web searches indicated I should be using _beginthreadex instead of CreateThread for C runtime compatibility.
author Eric Wing <ewing . public |-at-| gmail . com>
date Fri, 08 Jun 2012 01:04:51 -0700
parents 71b465ff0622
children
line wrap: on
line source

#ifndef SIMPLE_SEMAPHORE_H
#define SIMPLE_SEMAPHORE_H

#ifdef __cplusplus
extern "C" {
#endif

	
typedef struct SimpleSemaphore SimpleSemaphore;

SimpleSemaphore* SimpleSemaphore_CreateSemaphore(int initial_value);

void SimpleSemaphore_DestroySemaphore(SimpleSemaphore* simple_semaphore);

int SimpleSemaphore_SemaphoreTryWait(SimpleSemaphore* simple_semaphore);
int SimpleSemaphore_SemaphoreWait(SimpleSemaphore* simple_semaphore);
int SimpleSemaphore_SemaphoreGetValue(SimpleSemaphore* simple_semaphore);
int SimpleSemaphore_SemaphorePost(SimpleSemaphore* simple_semaphore);

/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif

#endif