mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-14 15:05:35 +02:00
SF 1939071 and 1928786
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user