mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-24 17:30:44 +02:00
added start() method that takes a Poco::SharedPtr to a Runnable
This commit is contained in:
@@ -144,6 +144,12 @@ public:
|
||||
/// valid during the entire lifetime of the thread, as
|
||||
/// only a reference to it is stored internally.
|
||||
|
||||
void start(Poco::SharedPtr<Runnable> pTarget);
|
||||
/// Starts the thread with the given target.
|
||||
///
|
||||
/// The Thread ensures that the given target stays
|
||||
/// alive while the thread is running.
|
||||
|
||||
void start(Callable target, void* pData = 0);
|
||||
/// Starts the thread with the given target and parameter.
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace Poco {
|
||||
|
||||
namespace {
|
||||
|
||||
|
||||
class RunnableHolder: public Runnable
|
||||
{
|
||||
public:
|
||||
@@ -129,6 +130,12 @@ void Thread::start(Runnable& target)
|
||||
}
|
||||
|
||||
|
||||
void Thread::start(Poco::SharedPtr<Runnable> pTarget)
|
||||
{
|
||||
startImpl(pTarget);
|
||||
}
|
||||
|
||||
|
||||
void Thread::start(Callable target, void* pData)
|
||||
{
|
||||
startImpl(new CallableHolder(target, pData));
|
||||
|
||||
Reference in New Issue
Block a user