Thread::Config has a named parameters style allowing method chaining to create a Thread with certain parameters and without the need to derive from epicsThreadRunnable. It also makes it easy to give a meaningful name (pvAccess needs work here).
using namespace epics::pvData;
klass *K = ...;
Thread foo(Thread::Config(K, &klass::meth)
.prio(epicsThreadPriorityMedium)
<<"test"<<2
);
Creates a thread named "test2" where the thread main is a class method. Also works with epicsThreadRunnable subclasses, and C void()(void) + void*.
If not specified, priority defaults to epicsThreadPriorityLow, stack size to epicsThreadStackSmall, and autostart to true (in keeping with the other Thread constructors).
Thread::Config has a named parameters style allowing method chaining to create a Thread with certain parameters and without the need to derive from epicsThreadRunnable. It also makes it easy to give a meaningful name (pvAccess needs work here).
Creates a thread named "test2" where the thread main is a class method. Also works with epicsThreadRunnable subclasses, and C void()(void) + void*.
If not specified, priority defaults to epicsThreadPriorityLow, stack size to epicsThreadStackSmall, and autostart to true (in keeping with the other Thread constructors).