Logo Search packages:      
Sourcecode: pan version File versions  Download package

void WorkerPool::push_work ( Worker *  w,
Worker::Listener *  l,
bool  del_worker_when_done 

Enqueues a worker so its do_work() is called in a worker thread. After that, the following will be done in the main thread: 1. if a listener was provided, its on_work_done() method is called. 2. if delete_worker was true, the worker will be deleted.

Definition at line 60 of file worker-pool.cc.

  w->cancelled = false;
  w->silent = false;
  w->pool = this;
  w->listener = l;
  w->delete_worker = delete_worker;
  my_workers.insert (w);
  g_thread_pool_push (tpool, w, 0); // jump to worker_thread_func

Generated by  Doxygen 1.6.0   Back to index