30 throw std::logic_error(
"Already started");
35 for(
unsigned i=0;
i<nworkers;
i++) {
36 p2p::auto_ptr<epicsThread> worker(
new epicsThread(*
this, name.c_str(),
42 workers.push_back(worker.get());
67 for(workers_t::iterator it(temp.begin()), end(temp.end()); it!=end; ++it)
88 empty = queue.empty();
90 queue.push_back(work);
102 std::tr1::shared_ptr<epicsThreadRunable> work;
104 while(state==Active) {
107 work = queue.front().lock();
111 bool last = queue.empty();
120 }
catch(std::exception& e){
122 name.c_str(),
typeid(work.get()).name(), e.what());
epics::pvData::BitSetPtr empty
epicsGuard< epicsMutex > Guard
std::tr1::weak_ptr< epicsThreadRunable > value_type
WorkQueue(const std::string &name)
void add(const value_type &work)
LIBCOM_API unsigned int epicsStdCall epicsThreadGetStackSize(epicsThreadStackSizeClass size)
int errlogPrintf(const char *pFormat,...)
APIs for the epicsEvent binary semaphore.
epicsGuardRelease< epicsMutex > UnGuard
C++ and C descriptions for a thread.
void start(unsigned nworkers=1, unsigned prio=epicsThreadPriorityLow)