forked from DC-SWAT/DreamShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsyncos.h
More file actions
44 lines (38 loc) · 1.16 KB
/
syncos.h
File metadata and controls
44 lines (38 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
** $Id: syncos.h 10 2007-09-15 19:37:27Z danielq $
** Os Abstraction: Declarations
** SoongSoft, Argentina
** http://www.soongsoft.com mailto:dq@soongsoft.com
** Copyright (C) 2003-2006 Daniel Quintela. All rights reserved.
*/
#ifndef SYNCOS_H_INCLUDED
#define SYNCOS_H_INCLUDED
#ifdef NATV_WIN32
#define OS_THREAD_FUNC unsigned __stdcall
#define OS_THREAD_T long
#else
#define OS_THREAD_FUNC void *
#define OS_THREAD_T pthread_t
#endif
#ifdef NATV_WIN32
typedef unsigned ( __stdcall *OS_THREAD )( void * );
#else
typedef void * ( *OS_THREAD )( void * );
#endif
#ifndef _WIN32
#define INFINITE -1
#endif
long OsCreateThread( OS_THREAD_T *th, OS_THREAD threadfunc, void *param);
long OsCancelThread( OS_THREAD_T th);
long OsCreateEvent( char *name);
long OsSetEvent( long evt);
void OsCloseEvent( long evt);
void * OsCreateMutex( char *name);
long OsLockMutex( void *mtx, long timeout);
long OsUnlockMutex( void * mtx);
void OsCloseMutex( void * mtx);
long OsCreateThreadDataKey();
void OsSetThreadData( long key, const void *tdata);
void *OsGetThreadData( long key);
void OsSleep( long ms);
#endif