mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-25 18:22:59 +02:00
Fedora Core9/g++ 4.3.0 compilations fixes
This commit is contained in:
@@ -42,6 +42,7 @@
|
|||||||
#include "Poco/NotificationStrategy.h"
|
#include "Poco/NotificationStrategy.h"
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
|
|||||||
@@ -153,14 +153,14 @@ int ThreadImpl::getMaxOSPriorityImpl()
|
|||||||
|
|
||||||
void ThreadImpl::setStackSizeImpl(int size)
|
void ThreadImpl::setStackSizeImpl(int size)
|
||||||
{
|
{
|
||||||
#if (POCO_OS == POCO_OS_CYGWIN)
|
#ifndef PTHREAD_STACK_MIN
|
||||||
_pData->stackSize = 0;
|
_pData->stackSize = 0;
|
||||||
#else
|
#else
|
||||||
if (size !=0 && size < PTHREAD_STACK_MIN)
|
if (size !=0 && size < PTHREAD_STACK_MIN)
|
||||||
size = PTHREAD_STACK_MIN;
|
size = PTHREAD_STACK_MIN;
|
||||||
|
|
||||||
_pData->stackSize = size;
|
_pData->stackSize = size;
|
||||||
#endif // (POCO_OS == POCO_OS_CYGWIN)
|
#endif // PTHREAD_STACK_MIN
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
#include "Poco/Buffer.h"
|
#include "Poco/Buffer.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <memory.h>
|
#include <cstring>
|
||||||
|
|
||||||
|
|
||||||
using Poco::Bugcheck;
|
using Poco::Bugcheck;
|
||||||
|
|||||||
@@ -269,9 +269,12 @@ void ThreadTest::testThreadFunction()
|
|||||||
|
|
||||||
void ThreadTest::testThreadStackSize()
|
void ThreadTest::testThreadStackSize()
|
||||||
{
|
{
|
||||||
int stackSize = 50000000;
|
// some platforms (e.g. Fedora Core9/g++ 4.3.0) ignore set stack size value
|
||||||
|
// so some asserts will fail here
|
||||||
|
|
||||||
|
int stackSize = 50000000;
|
||||||
Thread thread;
|
Thread thread;
|
||||||
|
|
||||||
assert (0 == thread.getStackSize());
|
assert (0 == thread.getStackSize());
|
||||||
thread.setStackSize(stackSize);
|
thread.setStackSize(stackSize);
|
||||||
assert (stackSize == thread.getStackSize());
|
assert (stackSize == thread.getStackSize());
|
||||||
@@ -282,11 +285,11 @@ void ThreadTest::testThreadStackSize()
|
|||||||
|
|
||||||
stackSize = 1;
|
stackSize = 1;
|
||||||
thread.setStackSize(stackSize);
|
thread.setStackSize(stackSize);
|
||||||
#if defined(POCO_OS_FAMILY_UNIX) && !(POCO_OS == POCO_OS_CYGWIN)
|
#ifdef PTHREAD_STACK_MIN
|
||||||
assert (PTHREAD_STACK_MIN == thread.getStackSize());
|
assert (PTHREAD_STACK_MIN == thread.getStackSize());
|
||||||
#else
|
#else
|
||||||
assert (stackSize == thread.getStackSize());
|
assert (stackSize == thread.getStackSize());
|
||||||
#endif
|
#endif // PTHREAD_STACK_MIN
|
||||||
tmp = MyRunnable::_staticVar;
|
tmp = MyRunnable::_staticVar;
|
||||||
thread.start(freeFunc, &tmp);
|
thread.start(freeFunc, &tmp);
|
||||||
thread.join();
|
thread.join();
|
||||||
|
|||||||
Reference in New Issue
Block a user