log4cplus
2.0.0
|
00001 // -*- C++ -*- 00002 // Module: Log4CPLUS 00003 // File: thread-config.h 00004 // Created: 4/2003 00005 // Author: Tad E. Smith 00006 // 00007 // 00008 // Copyright 2003-2015 Tad E. Smith 00009 // 00010 // Licensed under the Apache License, Version 2.0 (the "License"); 00011 // you may not use this file except in compliance with the License. 00012 // You may obtain a copy of the License at 00013 // 00014 // http://www.apache.org/licenses/LICENSE-2.0 00015 // 00016 // Unless required by applicable law or agreed to in writing, software 00017 // distributed under the License is distributed on an "AS IS" BASIS, 00018 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00019 // See the License for the specific language governing permissions and 00020 // limitations under the License. 00023 #ifndef LOG4CPLUS_HELPERS_THREAD_CONFIG_HEADER_ 00024 #define LOG4CPLUS_HELPERS_THREAD_CONFIG_HEADER_ 00025 00026 #if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE) 00027 #pragma once 00028 #endif 00029 00030 #if defined (LOG4CPLUS_USE_PTHREADS) 00031 # if defined (__APPLE__) 00032 # define LOG4CPLUS_USE_NAMED_POSIX_SEMAPHORE 00033 # endif 00034 00035 #elif defined(LOG4CPLUS_USE_WIN32_THREADS) 00036 # define LOG4CPLUS_USE_SRW_LOCK 00037 //# define LOG4CPLUS_POOR_MANS_SHAREDMUTEX 00038 # undef LOG4CPLUS_HAVE_TLS_SUPPORT 00039 # undef LOG4CPLUS_THREAD_LOCAL_VAR 00040 # if defined (_MSC_VER) 00041 // The __declspec(thread) functionality is not compatible with LoadLibrary(). 00042 // For more information why see and "Windows and TLS" note in README. 00043 // <http://msdn.microsoft.com/en-us/library/2s9wt68x(v=vs.100).aspx>. 00044 # define LOG4CPLUS_HAVE_TLS_SUPPORT 1 00045 # define LOG4CPLUS_THREAD_LOCAL_VAR __declspec(thread) 00046 # endif 00047 00048 #elif defined(LOG4CPLUS_SINGLE_THREADED) 00049 # undef LOG4CPLUS_HAVE_TLS_SUPPORT 00050 # undef LOG4CPLUS_THREAD_LOCAL_VAR 00051 00052 #else 00053 # error "You Must define a Threading model" 00054 00055 #endif 00056 00057 00058 #endif // LOG4CPLUS_HELPERS_THREAD_CONFIG_HEADER_