STXXL  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
request_with_waiters.h
Go to the documentation of this file.
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_HEADER
15 #define STXXL_IO_REQUEST_WITH_WAITERS_HEADER
16 
17 #include <set>
18 
22 #include <stxxl/bits/namespace.h>
23 
24 
26 
27 //! \addtogroup fileimpl
28 //! \{
29 
30 //! Request that is aware of threads waiting for it to complete.
32 {
34  std::set<onoff_switch*> waiters;
35 
36 protected:
37  bool add_waiter(onoff_switch* sw);
38  void delete_waiter(onoff_switch* sw);
39  void notify_waiters();
40  /*
41  int nwaiters(); // returns number of waiters
42  */
43 };
44 
45 //! \}
46 
48 
49 #endif // !STXXL_IO_REQUEST_WITH_WAITERS_HEADER
50 // vim: et:ts=4:sw=4
std::set< onoff_switch * > waiters
Request that is aware of threads waiting for it to complete.
#define STXXL_BEGIN_NAMESPACE
Definition: namespace.h:16
Functional interface of a request.
#define STXXL_END_NAMESPACE
Definition: namespace.h:17