Solaris and non-Cygwin pthreads fixes (Serge: backport to 1.3.3)

This commit is contained in:
Aleksandar Fabijanic 2008-05-14 18:12:04 +00:00
parent f5c0603771
commit 81fcb5cbf5
2 changed files with 10 additions and 7 deletions

View File

@ -39,8 +39,10 @@
#include "Poco/ErrorHandler.h"
#include <signal.h>
#if defined(__sun) && defined(__SVR4)
#define __EXTENSIONS__
#include <limits.h>
# if !defined(__EXTENSIONS__)
# define __EXTENSIONS__
# endif
# include <limits.h>
#endif
@ -151,14 +153,14 @@ int ThreadImpl::getMaxOSPriorityImpl()
void ThreadImpl::setStackSizeImpl(int size)
{
#ifdef POCO_OS_CYGWIN
#if (POCO_OS == POCO_OS_CYGWIN)
_pData->stackSize = 0;
#else
if (size !=0 && size < PTHREAD_STACK_MIN)
size = PTHREAD_STACK_MIN;
_pData->stackSize = size;
#endif
#endif // (POCO_OS == POCO_OS_CYGWIN)
}

View File

@ -37,9 +37,10 @@
#include "Poco/Runnable.h"
#include "Poco/ThreadTarget.h"
#include "Poco/Event.h"
#include <iostream>
#if defined(__sun) && defined(__SVR4)
#define __EXTENSIONS__
# if !defined(__EXTENSIONS__)
# define __EXTENSIONS__
# endif
#include <limits.h>
#endif
@ -281,7 +282,7 @@ void ThreadTest::testThreadStackSize()
stackSize = 1;
thread.setStackSize(stackSize);
#if defined(POCO_OS_FAMILY_UNIX) && !defined(POCO_OS_CYGWIN)
#if defined(POCO_OS_FAMILY_UNIX) && !(POCO_OS == POCO_OS_CYGWIN)
assert (PTHREAD_STACK_MIN == thread.getStackSize());
#else
assert (stackSize == thread.getStackSize());