24 #if STXXL_STD_THREADS && STXXL_MSVC >= 1700
28 #ifndef STXXL_CHECK_FOR_PENDING_REQUESTS_ON_SUBMISSION
29 #define STXXL_CHECK_FOR_PENDING_REQUESTS_ON_SUBMISSION 1
34 struct file_offset_match :
public std::binary_function<request_ptr, request_ptr, bool>
41 return (a->get_offset() == b->get_offset()) &&
42 (a->get_file() == b->get_file());
46 request_queue_impl_1q::request_queue_impl_1q(
int n)
47 : m_thread_state(NOT_RUNNING), sem(0)
60 #if STXXL_CHECK_FOR_PENDING_REQUESTS_ON_SUBMISSION
67 STXXL_ERRMSG(
"request submitted for a BID with a pending request");
84 bool was_still_in_queue =
false;
87 queue_type::iterator pos;
91 was_still_in_queue =
true;
96 return was_still_in_queue;
106 self* pthis =
static_cast<self*
>(arg);
114 if (!pthis->queue.empty())
117 pthis->queue.pop_front();
134 if ((pthis->sem--) == 0)
143 #if STXXL_STD_THREADS && STXXL_MSVC >= 1700
static void * worker(void *arg)
void unlock()
unlock mutex hold prematurely
External FIFO queue container. Introduction to queue container: see STXXL Queue tutorial Design a...
counting_ptr< request > request_ptr
A reference counting pointer for request.
void add_request(request_ptr &req)
bool empty() const
test for a NULL pointer
#define STXXL_THROW_INVALID_ARGUMENT(error_message)
Throws std::invalid_argument with "Error in [function] : [error_message]".
void stop_thread(thread_type &t, state< thread_state > &s, semaphore &sem)
Aquire a lock that's valid until the end of scope.
#define STXXL_BEGIN_NAMESPACE
void STXXL_UNUSED(const U &)
state< thread_state > m_thread_state
void start_thread(void *(*worker)(void *), void *arg, thread_type &t, state< thread_state > &s)
#define _STXXL_FORCE_SEQUENTIAL
bool cancel_request(request_ptr &req)
ExtIterator find(ExtIterator begin, ExtIterator end, const EqualityComparable &value, int_type nbuffers=0)
External equivalent of std::find, see stxxl::find.
#define STXXL_END_NAMESPACE