9#if defined(_WIN32) && !defined(HAVE_PTHREAD)
10#if defined(USE_MOTIF) || defined(GTK)
13#define boolean wboolean
18#define HAVE_BEGINTHREADEX
20#if defined(USE_MOTIF) || defined(USE_GTK)
25#elif defined(MACOS) && !defined(MACOSX)
27#elif defined(MACOSX) || defined(HAVE_PTHREAD)
40#define SP_THREAD_PRIORITY_TIME_CRITICAL 15
41#define SP_THREAD_PRIORITY_HIGHEST 2
42#define SP_THREAD_PRIORITY_ABOVE_NORMAL 1
43#define SP_THREAD_PRIORITY_NORMAL 0
44#define SP_THREAD_PRIORITY_BELOW_NORMAL (-1)
45#define SP_THREAD_PRIORITY_LOWEST (-2)
46#define SP_THREAD_PRIORITY_IDLE (-15)
48#define SP_THREAD_EXIT_SUCCESS 0
49#define SP_THREAD_EXIT_FAILURE -2
50#define SP_THREAD_EXIT_CANCELED -1
52#define SP_EVENT_TIMEOUT_INFINITE -1
53#define SP_EVENT_WAIT_FAILED -1
54#define SP_EVENT_WAIT_SIGNALED 0
55#define SP_EVENT_WAIT_TIMEOUT 1
56#define SP_EVENT_WAIT_ABANDONED 2
59 SP_THREAD_LEVEL_LOW = 0,
60 SP_THREAD_LEVEL_BELOW_MIDDLE = 25,
61 SP_THREAD_LEVEL_MIDDLE = 50,
62 SP_THREAD_LEVEL_ABOVE_MIDDLE = 75,
63 SP_THREAD_LEVEL_HIGH = 100,
68#if defined(_WIN32) && !defined(HAVE_PTHREAD)
69#if defined(HAVE_BEGINTHREADEX)
71#define spThreadReturn unsigned __stdcall
73typedef unsigned (__stdcall *spThreadFunc)(
void *data);
76#define spThreadReturn DWORD WINAPI
78typedef DWORD (WINAPI *spThreadFunc)(
void *data);
81#define SP_THREAD_RETURN_SUCCESS 0
82#define SP_THREAD_RETURN_FAILURE 1
85#define spThreadId DWORD
89#define spThreadReturn void *
90typedef spThreadReturn (*spThreadFunc)(
void *data);
92#define SP_THREAD_RETURN_SUCCESS (void *)0
93#define SP_THREAD_RETURN_FAILURE (void *)1
95#if defined(MACOS) && !defined(MACOSX)
97#define spThreadId ThreadID
100#define spThreadId pthread_t
123extern int spGetNumCoopThreadMac(
void);
127extern void *
spCreateThread(
long stacksize,
int priority, spThreadFunc func,
void *data);
171extern spBool spIsThreadLevelVariable(
void);
172extern spBool spIsLowLevelThreadUsed(
void);
173extern spBool spSetThreadLevel(spThreadLevel level);
174extern spThreadLevel spGetThreadLevel(
void);
int spBool
Definition spDefs.h:248
void * spCreateThread(long stacksize, int priority, spThreadFunc func, void *data)
void * spCreateEvent(spBool manual_reset, spBool initial_signal)
long spWaitThread(void *handle)
spBool spLockMutex(void *handle)
spThreadId spGetCurrentThreadId(void)
void(* spCommandThreadCallback)(spCommandThreadStatus status, long data, void *user_data)
Definition spThread.h:118
spBool spPulseEvent(void *handle)
void * spCreateMutex(const char *name)
spBool spDestroyEvent(void *handle)
spBool spUnlockMutex(void *handle)
spCommandThreadStatus
Definition spThread.h:109
void spDestroyMutex(void *handle)
spBool spWaitEvent(void *handle)
void spExitThread(long status)
int spWaitEventTimeout(void *handle, long timeout_ms)
spBool spEqThreadId(spThreadId id1, spThreadId id2)
spBool spWaitMutex(void *handle)
spBool spSetEvent(void *handle)
spBool spCreateCommandThread(const char *command, spCommandThreadCallback func, void *data)
spThreadId spGetThreadId(void *handle)
spBool spResetEvent(void *handle)
void spDestroyThread(void *handle)
@ SP_COMMAND_THREAD_COMMAND_FINISHED
Definition spThread.h:112
@ SP_COMMAND_THREAD_STARTED
Definition spThread.h:110
@ SP_COMMAND_THREAD_FINISHED
Definition spThread.h:111
@ SP_COMMAND_THREAD_COMMAND_FAILED
Definition spThread.h:113
@ SP_COMMAND_THREAD_COMMAND_WAIT_FAILED
Definition spThread.h:114