Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 37 lines (28 sloc) 1.148 kb
eb6b53b @Arke64 Reverted include changes, polished some indentations, added thread termi...
Arke64 authored
1 #ifndef SAL_INCLUDE_THREAD
2 #define SAL_INCLUDE_THREAD
3
4 #include "Common.h"
5
6 #ifdef WINDOWS
7 typedef unsigned long (__stdcall *SAL_Thread_StartAddress)(void* SAL_Thread_StartParameter);
8 typedef void* SAL_Thread;
9 typedef void* SAL_Mutex;
002edab @Arke64 Changed the event API to use semaphores
Arke64 authored
10 typedef void* SAL_Semaphore;
eb6b53b @Arke64 Reverted include changes, polished some indentations, added thread termi...
Arke64 authored
11 #elif defined POSIX
12 #include <pthread.h>
13 #include <errno.h>
002edab @Arke64 Changed the event API to use semaphores
Arke64 authored
14
eb6b53b @Arke64 Reverted include changes, polished some indentations, added thread termi...
Arke64 authored
15 typedef void* (*SAL_Thread_StartAddress)(void* SAL_Thread_StartParameter);
16 typedef pthread_t SAL_Thread;
17
18 typedef pthread_mutex_t* SAL_Mutex;
002edab @Arke64 Changed the event API to use semaphores
Arke64 authored
19 typedef pthread_cond_t* SAL_Semaphore;
eb6b53b @Arke64 Reverted include changes, polished some indentations, added thread termi...
Arke64 authored
20 #endif
21
22 public SAL_Thread SAL_Thread_Create(SAL_Thread_StartAddress startAddress, void* startParameter);
23 public uint64 SAL_Thread_Join(SAL_Thread thread);
24 public void SAL_Thread_Exit(uint32 exitCode);
25
26 public SAL_Mutex SAL_Mutex_Create(void);
27 public uint8 SAL_Mutex_Free(SAL_Mutex mutex);
28 public void SAL_Mutex_Acquire(SAL_Mutex mutex);
29 public void SAL_Mutex_Release(SAL_Mutex mutex);
30
002edab @Arke64 Changed the event API to use semaphores
Arke64 authored
31 public SAL_Semaphore SAL_Semaphore_Create(void);
32 public void SAL_Semaphore_Free(SAL_Semaphore Semaphore);
33 public void SAL_Semaphore_Decrement(SAL_Semaphore Semaphore);
34 public void SAL_Semaphore_Increment(SAL_Semaphore Semaphore);
eb6b53b @Arke64 Reverted include changes, polished some indentations, added thread termi...
Arke64 authored
35
36 #endif
Something went wrong with that request. Please try again.