version 1.1.2.8, 2006/07/28 21:26:39
|
version 1.2, 2006/08/09 21:12:42
|
|
|
| |
//============================================================================== | //============================================================================== |
// | // |
// Thread-related type definitions |
// ThreadType |
// | // |
//============================================================================== | //============================================================================== |
| |
#if defined(PEGASUS_HAVE_PTHREADS) | #if defined(PEGASUS_HAVE_PTHREADS) |
|
|
struct ThreadType | struct ThreadType |
{ | { |
public: | public: |
|
|
| |
private: | private: |
pthread_t _thread; | pthread_t _thread; |
|
// An id of zero indicates a null object. 1 indicates the main thread. |
// And id of zero indicates a null object. 1 indicates the main thread. |
|
Uint32 _id; | Uint32 _id; |
friend class Threads; | friend class Threads; |
}; | }; |
|
#endif /* PEGASUS_HAVE_PTHREADS */ |
typedef void* ThreadReturnType; |
|
#endif |
|
| |
#if defined(PEGASUS_HAVE_WINDOWS_THREADS) | #if defined(PEGASUS_HAVE_WINDOWS_THREADS) |
struct ThreadType | struct ThreadType |
{ | { |
ThreadType() : handle(NULL) { } | ThreadType() : handle(NULL) { } |
|
|
HANDLE handle; | HANDLE handle; |
}; | }; |
|
#endif /* PEGASUS_HAVE_WINDOWS_THREADS */ |
|
|
|
//============================================================================== |
|
// |
|
// ThreadReturnType |
|
// |
|
//============================================================================== |
|
|
|
#if defined(PEGASUS_HAVE_PTHREADS) |
|
typedef void* ThreadReturnType; |
|
#endif |
|
|
|
#if defined(PEGASUS_HAVE_WINDOWS_THREADS) |
typedef unsigned ThreadReturnType; | typedef unsigned ThreadReturnType; |
#endif | #endif |
| |
|
|
defined(PEGASUS_PLATFORM_HPUX_ACC) || \ | defined(PEGASUS_PLATFORM_HPUX_ACC) || \ |
defined(PEGASUS_PLATFORM_OS400_ISERIES_IBM) || \ | defined(PEGASUS_PLATFORM_OS400_ISERIES_IBM) || \ |
defined(PEGASUS_PLATFORM_TRU64_ALPHA_DECCXX) || \ | defined(PEGASUS_PLATFORM_TRU64_ALPHA_DECCXX) || \ |
defined(PEGASUS_OS_VMS) |
defined(PEGASUS_OS_VMS) || \ |
|
defined(PEGASUS_OS_ZOS) |
sched_yield(); | sched_yield(); |
#else | #else |
pthread_yield(); | pthread_yield(); |