activemq-cpp-3.6.0
PlatformDefs.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 #ifndef _DECAF_INTERNAL_UTIL_CONCURRENT_WINDOWS_PLATFORMDEFS_H_
19 #define _DECAF_INTERNAL_UTIL_CONCURRENT_WINDOWS_PLATFORMDEFS_H_
20 
21 #include <decaf/util/Config.h>
22 
23 #if HAVE_SIGNAL_H
24 #include <signal.h>
25 #endif
26 #if HAVE_STRING_H
27 #include <string.h>
28 #endif
29 #if HAVE_SCHED_H
30 #include <sched.h>
31 #endif
32 #if HAVE_SYS_TIME_H
33 #include <sys/time.h>
34 #endif
35 #if HAVE_UNISTD_H
36 #include <unistd.h>
37 #endif
38 #if HAVE_TIME_H
39 #include <time.h>
40 #endif
41 #ifdef HAVE_PROCESS_H
42 #include <process.h>
43 #endif
44 
45 namespace decaf{
46 namespace internal{
47 namespace util{
48 namespace concurrent{
49 
50  struct RWLOCK {
51  HANDLE writeMutex;
52  HANDLE readEvent;
53  volatile LONG readers;
54  };
55 
56  typedef void* PLATFORM_THREAD_ENTRY_ARG;
57 
58  #define PLATFORM_THREAD_RETURN() return 0;
59  #define PLATFORM_THREAD_CALLBACK_TYPE unsigned
60  #define PLATFORM_DEFAULT_STACK_SIZE 0x8000
61  #define PLATFORM_CALLING_CONV __stdcall
62 
63  typedef HANDLE decaf_thread_t;
64  typedef DWORD decaf_tls_key;
65  typedef HANDLE decaf_condition_t;
66  typedef LPCRITICAL_SECTION decaf_mutex_t;
67  typedef RWLOCK* decaf_rwmutex_t;
68 
69 }}}}
70 
71 #endif /* _DECAF_INTERNAL_UTIL_CONCURRENT_WINDOWS_PLATFORMDEFS_H_ */