Changeset 699 for trunk/pdns/pdns/mtasker.hh
- Timestamp:
- 04/14/06 13:26:50 (4 years ago)
- Files:
-
- 1 modified
-
trunk/pdns/pdns/mtasker.hh (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/mtasker.hh
r681 r699 51 51 std::queue<int> d_zombiesQueue; 52 52 53 54 typedef std::map<int, ucontext_t*> mthreads_t; 55 mthreads_t d_threads; 56 int d_tid; 57 int d_maxtid; 58 size_t d_stacksize; 59 60 EventVal d_waitval; 61 enum {Error=-1,TimeOut=0,Answer} d_waitstatus; 62 63 public: 53 64 struct Waiter 54 65 { … … 58 69 int tid; 59 70 }; 60 61 // typedef std::map<EventKey,Waiter> waiters_t;62 71 63 72 typedef multi_index_container< … … 71 80 waiters_t d_waiters; 72 81 73 typedef std::map<int, ucontext_t*> mthreads_t;74 mthreads_t d_threads;75 int d_tid;76 int d_maxtid;77 size_t d_stacksize;78 79 EventVal d_waitval;80 enum {Error=-1,TimeOut=0,Answer} d_waitstatus;81 82 public:83 82 //! Constructor 84 83 /** Constructor with a small default stacksize. If any of your threads exceeds this stack, your application will crash. … … 92 91 93 92 typedef void tfunc_t(void *); //!< type of the pointer that starts a thread 94 int waitEvent( constEventKey &key, EventVal *val=0, unsigned int timeout=0);93 int waitEvent(EventKey &key, EventVal *val=0, unsigned int timeout=0); 95 94 void yield(); 96 95 int sendEvent(const EventKey& key, const EventVal* val=0); … … 104 103 private: 105 104 static void threadWrapper(MTasker *self, tfunc_t *tf, int tid, void* val); 105 EventKey d_eventkey; // for waitEvent, contains exact key it was awoken for 106 106 }; 107 107 #include "mtasker.cc"