STXXL
1.4.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
request_queue_impl_worker.h
Go to the documentation of this file.
1
/***************************************************************************
2
* include/stxxl/bits/io/request_queue_impl_worker.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, 2009 Andreas Beckmann <
[email protected]
>
8
* Copyright (C) 2009 Johannes Singler <
[email protected]
>
9
* Copyright (C) 2013 Timo Bingmann <
[email protected]
>
10
*
11
* Distributed under the Boost Software License, Version 1.0.
12
* (See accompanying file LICENSE_1_0.txt or copy at
13
* http://www.boost.org/LICENSE_1_0.txt)
14
**************************************************************************/
15
16
#ifndef STXXL_IO_REQUEST_QUEUE_IMPL_WORKER_HEADER
17
#define STXXL_IO_REQUEST_QUEUE_IMPL_WORKER_HEADER
18
19
#include <
stxxl/bits/config.h
>
20
21
#if STXXL_STD_THREADS
22
#include <thread>
23
#elif STXXL_BOOST_THREADS
24
#include <boost/thread/thread.hpp>
25
#elif STXXL_POSIX_THREADS
26
#include <pthread.h>
27
#else
28
#error "Thread implementation not detected."
29
#endif
30
31
#include <
stxxl/bits/io/request_queue.h
>
32
#include <
stxxl/bits/common/semaphore.h
>
33
#include <
stxxl/bits/common/state.h
>
34
35
36
STXXL_BEGIN_NAMESPACE
37
38
//! \addtogroup iolayer
39
//! \{
40
41
class
request_queue_impl_worker
:
public
request_queue
42
{
43
protected
:
44
enum
thread_state
{ NOT_RUNNING, RUNNING, TERMINATING, TERMINATED };
45
46
#if STXXL_STD_THREADS
47
typedef
std::thread* thread_type;
48
#elif STXXL_BOOST_THREADS
49
typedef
boost::thread* thread_type;
50
#else
51
typedef
pthread_t
thread_type
;
52
#endif
53
54
protected
:
55
void
start_thread(
void
* (* worker)(
void
*),
void
* arg,
thread_type
& t,
state<thread_state>
& s);
56
void
stop_thread(
thread_type
& t,
state<thread_state>
& s,
semaphore
& sem);
57
};
58
59
//! \}
60
61
STXXL_END_NAMESPACE
62
63
#endif // !STXXL_IO_REQUEST_QUEUE_IMPL_WORKER_HEADER
64
// vim: et:ts=4:sw=4
stxxl::request_queue
Definition:
request_queue.h:26
stxxl::semaphore
Definition:
semaphore.h:24
config.h
stxxl::request_queue_impl_worker::thread_type
pthread_t thread_type
Definition:
request_queue_impl_worker.h:51
stxxl::request_queue_impl_worker
Definition:
request_queue_impl_worker.h:41
stxxl::state< thread_state >
STXXL_BEGIN_NAMESPACE
#define STXXL_BEGIN_NAMESPACE
Definition:
namespace.h:16
stxxl::request_queue_impl_worker::thread_state
thread_state
Definition:
request_queue_impl_worker.h:44
semaphore.h
state.h
request_queue.h
STXXL_END_NAMESPACE
#define STXXL_END_NAMESPACE
Definition:
namespace.h:17
include
stxxl
bits
io
request_queue_impl_worker.h
STXXL 1.4.0
- Generated on Thu Dec 12 2013 15:30:25 for STXXL by
1.8.5