00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef STXXL_IO__REQUEST_WITH_WAITERS_H_
00015 #define STXXL_IO__REQUEST_WITH_WAITERS_H_
00016
00017 #include <set>
00018
00019 #include <stxxl/bits/common/mutex.h>
00020 #include <stxxl/bits/common/switch.h>
00021 #include <stxxl/bits/io/request_interface.h>
00022
00023
00024 __STXXL_BEGIN_NAMESPACE
00025
00028
00030 class request_with_waiters : virtual public request_interface
00031 {
00032 mutex waiters_mutex;
00033 std::set<onoff_switch *> waiters;
00034
00035 protected:
00036 bool add_waiter(onoff_switch * sw);
00037 void delete_waiter(onoff_switch * sw);
00038 void notify_waiters();
00039
00040
00041
00042 };
00043
00045
00046 __STXXL_END_NAMESPACE
00047
00048 #endif // !STXXL_IO__REQUEST_WITH_WAITERS_H_
00049