SF 1939071 and 1928786

This commit is contained in:
Aleksandar Fabijanic
2008-04-11 01:37:49 +00:00
parent 32c38a9197
commit 89ca50a581
14 changed files with 548 additions and 41 deletions

View File

@@ -68,6 +68,8 @@ class Foundation_API Thread: private ThreadImpl
/// The name of a thread can be changed at any time.
{
public:
using ThreadImpl::Callback;
enum Priority
/// Thread priorities.
{
@@ -108,9 +110,22 @@ public:
Priority getPriority() const;
/// Returns the thread's priority.
void setStackSize(std::size_t size);
/// Sets the thread's stack size in bytes.
/// Setting the stack size to 0 will use the default stack size.
/// Typically, the real stack size is rounded up to the nearest
/// page size multiple.
std::size_t getStackSize() const;
/// Returns the thread's stack size in bytes.
/// If the default stack size is used, 0 is returned.
void start(Runnable& target);
/// Starts the thread with the given target.
void start(Callback target, void* pData = 0);
/// Starts the thread with the given target and parameter.
void join();
/// Waits until the thread completes execution.
/// If multiple threads try to join the same
@@ -216,6 +231,18 @@ inline Thread* Thread::current()
}
inline void Thread::setStackSize(std::size_t size)
{
setStackSizeImpl(size);
}
inline std::size_t Thread::getStackSize() const
{
return getStackSizeImpl();
}
} // namespace Poco