~ubuntu-branches/ubuntu/maverick/pdns/maverick-updates

« back to all changes in this revision

Viewing changes to pdns/mtasker.hh

  • Committer: Bazaar Package Importer
  • Author(s): Debian PowerDNS Maintainers
  • Date: 2006-05-06 10:40:44 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060506104044-v9hczzfl7dcri6qt
Tags: 2.9.20-3
Disable the recursor, this is in a separate package now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include <vector> 
30
30
#include <map>
31
31
#include <time.h>
 
32
#include <boost/multi_index_container.hpp>
 
33
#include <boost/multi_index/ordered_index.hpp>
 
34
#include <boost/multi_index/key_extractors.hpp>
 
35
using namespace boost;
 
36
using namespace ::boost::multi_index;
 
37
 
 
38
struct KeyTag {};
32
39
 
33
40
//! The main MTasker class    
34
41
/** The main MTasker class. See the main page for more information.
45
52
 
46
53
  struct Waiter
47
54
  {
 
55
    EventKey key;
48
56
    ucontext_t *context;
49
57
    time_t ttd;
50
58
    int tid;
51
59
  };
52
60
 
53
 
  typedef std::map<EventKey,Waiter> waiters_t;
 
61
  //  typedef std::map<EventKey,Waiter> waiters_t;
 
62
 
 
63
  typedef multi_index_container<
 
64
    Waiter,
 
65
    indexed_by <
 
66
                ordered_unique<member<Waiter,EventKey,&Waiter::key> >,
 
67
                ordered_non_unique<tag<KeyTag>, member<Waiter,time_t,&Waiter::ttd> >
 
68
               >
 
69
  > waiters_t;
 
70
 
54
71
  waiters_t d_waiters;
 
72
 
55
73
  typedef std::map<int,pair<ucontext_t*,string> > mthreads_t;
56
74
  mthreads_t d_threads;
57
75
  int d_tid;