00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef LIBMUTH_RUNNER_H
00020 #define LIBMUTH_RUNNER_H
00021
00022 #include "blockingqueue_decls.h"
00023 #include "coroutine_decls.h"
00024 #include "microthread.h"
00025 #include "globalqueue.h"
00026
00030 class Runner : public Coroutine {
00031 private:
00032 using Coroutine::swapto;
00039 void swapto(Microthread &o, bool acquired=false);
00040 BlockingQueue<Microthread*> &queue;
00041 public:
00046 inline Runner(BlockingQueue<Microthread*> *q=NULL)
00047 : queue(q ? *q : getglobalqueue()) {}
00053 void run();
00054 };
00055
00061 void *run_runner(void *p);
00062
00069 void runnerLoop(unsigned int n=1);
00070
00071 #endif