activemq-cpp-3.9.5
ThreadingTypes.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18
19#ifndef _DECAF_INTERNAL_UTIL_CONCURRENT_UNIX_THREADTYPES_H_
20#define _DECAF_INTERNAL_UTIL_CONCURRENT_UNIX_THREADTYPES_H_
21
22#include <decaf/util/Config.h>
23
24#ifdef HAVE_PTHREAD_H
26#else
28#endif
29
30namespace decaf{
31namespace lang{
32 class Thread;
33}
34namespace internal{
35namespace util{
36namespace concurrent{
37
41 #define DECAF_MAX_TLS_SLOTS 384
42
52
57 typedef void (*threadingTask)(void *);
58
59 // Forward Declare some of the nested types.
60 struct MonitorHandle;
61
94
106
108 public:
109
111
122 virtual bool operator()(bool timedOut DECAF_UNUSED) {
123 return this->operator()();
124 }
125
130 virtual bool operator()() {
131 return false;
132 }
133
134 };
135
136}}}}
137
138#endif /* _DECAF_INTERNAL_UTIL_CONCURRENT_UNIX_THREADTYPES_H_ */
#define DECAF_MAX_TLS_SLOTS
Max number of TLS keys that a thread can use.
Definition ThreadingTypes.h:41
virtual bool operator()()
Called from non-timed wait conditions to determine if the condition necessary to complete the wait ha...
Definition ThreadingTypes.h:130
virtual ~CompletionCondition()
Definition ThreadingTypes.h:110
virtual bool operator()(bool timedOut DECAF_UNUSED)
Called from timed wait condition methods to indicate if the timeout has occurred, allows this method ...
Definition ThreadingTypes.h:122
A Thread is a concurrent unit of execution.
Definition Thread.h:64
pthread_cond_t * decaf_condition_t
Definition PlatformDefs.h:58
pthread_mutex_t * decaf_mutex_t
Definition PlatformDefs.h:59
pthread_t decaf_thread_t
Definition PlatformDefs.h:56
void * PLATFORM_THREAD_ENTRY_ARG
Definition PlatformDefs.h:50
PLATFORM_THREAD_CALLBACK_TYPE(PLATFORM_CALLING_CONV * threadMainMethod)(PLATFORM_THREAD_ENTRY_ARG)
This is the main method for thread instances, this value is valid on any platform,...
Definition ThreadingTypes.h:51
void(* threadingTask)(void *)
The ThreadHandle contains one of these and it should be the method that does the actual work for the ...
Definition ThreadingTypes.h:57
Definition AprPool.h:26
Definition ThreadingTypes.h:31
Definition AbstractCollection.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25
MonitorHandle * next
Definition ThreadingTypes.h:104
bool initialized
Definition ThreadingTypes.h:103
unsigned int count
Definition ThreadingTypes.h:99
ThreadHandle * blocking
Definition ThreadingTypes.h:102
ThreadHandle * waiting
Definition ThreadingTypes.h:101
decaf_mutex_t lock
Definition ThreadingTypes.h:98
char * name
Definition ThreadingTypes.h:96
ThreadHandle * owner
Definition ThreadingTypes.h:100
decaf_mutex_t mutex
Definition ThreadingTypes.h:97
threadingTask threadMain
Definition ThreadingTypes.h:84
bool suspended
Definition ThreadingTypes.h:80
bool timerSet
Definition ThreadingTypes.h:72
void * threadArg
Definition ThreadingTypes.h:85
bool waiting
Definition ThreadingTypes.h:77
ThreadHandle * interruptingThread
Definition ThreadingTypes.h:88
decaf::lang::Thread * parent
Definition ThreadingTypes.h:63
bool blocked
Definition ThreadingTypes.h:79
long long threadId
Definition ThreadingTypes.h:86
void * tls[DECAF_MAX_TLS_SLOTS]
Definition ThreadingTypes.h:83
bool unparked
Definition ThreadingTypes.h:74
int priority
Definition ThreadingTypes.h:69
bool sleeping
Definition ThreadingTypes.h:76
bool notified
Definition ThreadingTypes.h:78
decaf_mutex_t mutex
Definition ThreadingTypes.h:65
bool osThread
Definition ThreadingTypes.h:87
ThreadHandle * next
Definition ThreadingTypes.h:90
bool canceled
Definition ThreadingTypes.h:73
char * name
Definition ThreadingTypes.h:81
volatile int references
Definition ThreadingTypes.h:68
decaf_thread_t handle
Definition ThreadingTypes.h:64
bool parked
Definition ThreadingTypes.h:75
int numAttached
Definition ThreadingTypes.h:89
long long stackSize
Definition ThreadingTypes.h:82
MonitorHandle * monitor
Definition ThreadingTypes.h:92
bool interrupted
Definition ThreadingTypes.h:70
volatile int state
Definition ThreadingTypes.h:67
ThreadHandle * joiners
Definition ThreadingTypes.h:91
decaf_condition_t condition
Definition ThreadingTypes.h:66
bool interruptible
Definition ThreadingTypes.h:71
#define PLATFORM_CALLING_CONV
Definition PlatformDefs.h:54
#define PLATFORM_THREAD_CALLBACK_TYPE
Definition PlatformDefs.h:52