mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-25 02:06:04 +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
|
/// valid during the entire lifetime of the thread, as
|
||||||
/// only a reference to it is stored internally.
|
/// 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);
|
void start(Callable target, void* pData = 0);
|
||||||
/// Starts the thread with the given target and parameter.
|
/// Starts the thread with the given target and parameter.
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ namespace Poco {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
|
||||||
class RunnableHolder: public Runnable
|
class RunnableHolder: public Runnable
|
||||||
{
|
{
|
||||||
public:
|
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)
|
void Thread::start(Callable target, void* pData)
|
||||||
{
|
{
|
||||||
startImpl(new CallableHolder(target, pData));
|
startImpl(new CallableHolder(target, pData));
|
||||||
|
|||||||
Reference in New Issue
Block a user