Stxxl  1.3.2
request_with_waiters.h
1 /***************************************************************************
2  * include/stxxl/bits/io/request_with_waiters.h
3  *
4  * Part of the STXXL. See http://stxxl.sourceforge.net
5  *
6  * Copyright (C) 2002 Roman Dementiev <[email protected]>
7  * Copyright (C) 2008 Andreas Beckmann <[email protected]>
8  *
9  * Distributed under the Boost Software License, Version 1.0.
10  * (See accompanying file LICENSE_1_0.txt or copy at
11  * http://www.boost.org/LICENSE_1_0.txt)
12  **************************************************************************/
13 
14 #ifndef STXXL_IO__REQUEST_WITH_WAITERS_H_
15 #define STXXL_IO__REQUEST_WITH_WAITERS_H_
16 
17 #include <set>
18 
19 #include <stxxl/bits/common/mutex.h>
20 #include <stxxl/bits/common/switch.h>
21 #include <stxxl/bits/io/request_interface.h>
22 
23 
24 __STXXL_BEGIN_NAMESPACE
25 
28 
31 {
32  mutex waiters_mutex;
33  std::set<onoff_switch *> waiters;
34 
35 protected:
36  bool add_waiter(onoff_switch * sw);
37  void delete_waiter(onoff_switch * sw);
38  void notify_waiters();
39  /*
40  int nwaiters(); // returns number of waiters
41  */
42 };
43 
45 
46 __STXXL_END_NAMESPACE
47 
48 #endif // !STXXL_IO__REQUEST_WITH_WAITERS_H_
49 // vim: et:ts=4:sw=4
Request that is aware of threads waiting for it to complete.
Definition: request_with_waiters.h:30
Functional interface of a request.
Definition: request_interface.h:37