00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef STXXL_IO_REQUEST_QUEUE_IMPL_1Q_HEADER
00015 #define STXXL_IO_REQUEST_QUEUE_IMPL_1Q_HEADER
00016
00017 #include <list>
00018
00019 #include <stxxl/bits/io/request_queue_impl_worker.h>
00020 #include <stxxl/bits/common/mutex.h>
00021
00022
00023 __STXXL_BEGIN_NAMESPACE
00024
00027
00028 class request_queue_impl_1q : public request_queue_impl_worker, public disk_queue
00029 {
00030 private:
00031 typedef request_queue_impl_1q self;
00032 typedef std::list<request_ptr> queue_type;
00033
00034 mutex queue_mutex;
00035 queue_type queue;
00036
00037 state<thread_state> _thread_state;
00038 thread_type thread;
00039 semaphore sem;
00040
00041 static const priority_op _priority_op = WRITE;
00042
00043 static void * worker(void * arg);
00044
00045 public:
00046
00047 request_queue_impl_1q(int n = 1);
00048
00049
00050
00051
00052
00053 void set_priority_op(priority_op op)
00054 {
00055
00056 STXXL_UNUSED(op);
00057 }
00058 void add_request(request_ptr & req);
00059 bool cancel_request(request_ptr & req);
00060 ~request_queue_impl_1q();
00061 };
00062
00064
00065 __STXXL_END_NAMESPACE
00066
00067 #endif // !STXXL_IO_REQUEST_QUEUE_IMPL_1Q_HEADER
00068