From d2b870cd9b6d91261a304e156819571acc309b55 Mon Sep 17 00:00:00 2001 From: rpj Date: Sat, 23 Feb 2002 02:01:11 +0000 Subject: * pthread_cond_destroy.c: Expand the time change critical section to solve deadlock problem. * pthread.c: Add all remaining C modules. * pthread.h: Use dllexport/dllimport attributes on functions to avoid using pthread.def. * sched.h: Likewise. * semaphore.h: Likewise. * GNUmakefile: Add new targets for single translation unit build to maximise inlining potential; generate pthread.def automatically. * Makefile: Likewise, but no longer uses pthread.def. --- sched.h | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'sched.h') diff --git a/sched.h b/sched.h index c1ba3bf..f6a732d 100644 --- a/sched.h +++ b/sched.h @@ -65,6 +65,24 @@ /* Include everything */ #endif + +#if __GNUC__ && ! defined (__declspec) +# error Please upgrade your GNU compiler to one that supports __declspec. +#endif + +/* + * When building the DLL code, you should define PTW32_BUILD so that + * the variables/functions are exported correctly. When using the DLL, + * do NOT define PTW32_BUILD, and then the variables/functions will + * be imported correctly. + */ +#ifdef PTW32_BUILD +# define PTW32_DLLPORT __declspec (dllexport) +#else +# define PTW32_DLLPORT __declspec (dllimport) +#endif + + #if defined(__MINGW32__) || defined(_UWIN) #if PTW32_LEVEL >= PTW32_LEVEL_MAX /* For pid_t */ @@ -95,15 +113,15 @@ extern "C" { #endif /* __cplusplus */ -int sched_yield (void); +PTW32_DLLPORT int sched_yield (void); -int sched_get_priority_min (int policy); +PTW32_DLLPORT int sched_get_priority_min (int policy); -int sched_get_priority_max (int policy); +PTW32_DLLPORT int sched_get_priority_max (int policy); -int sched_setscheduler (pid_t pid, int policy); +PTW32_DLLPORT int sched_setscheduler (pid_t pid, int policy); -int sched_getscheduler (pid_t pid); +PTW32_DLLPORT int sched_getscheduler (pid_t pid); /* * Note that this macro returns ENOTSUP rather than -- cgit v1.2.3