8000 Avoid using `std::mutex` with Visual Studio earlier than 2015. · log4cplus/log4cplus@bd27044 · GitHub
[go: up one dir, main page]

Skip to content

Commit bd27044

Browse files
committed
Avoid using std::mutex with Visual Studio earlier than 2015.
This works around issue with `std::mutex` locking during process shutdown. See also SF#343.
1 parent 41265e3 commit bd27044

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

include/log4cplus/config/win32.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#define LOG4CPLUS_HAVE_TIME_H
4444
#define LOG4CPLUS_HAVE_SYS_TIMEB_H
4545
#define LOG4CPLUS_HAVE_FTIME
46-
#if defined (_MSC_VER) || defined (__BORLANDC__)
46+
#if defined (_MSC_VER) || defined (__BORLANDC__)
4747
#define LOG4CPLUS_HAVE_GMTIME_S
4848
#endif
4949

@@ -162,6 +162,12 @@
162162
# endif
163163
# if _MSC_VER >= 1700
164164
# define LOG4CPLUS_HAVE_CXX11_ATOMICS
165+
# endif
166+
# if _MSC_VER >= 1900
167+
// C++11 threading facilities and synchronization primitives are available
168+
// already in earlier versions of Visual Studio compiler, however, there are
169+
// issues with the way mutexes are implemented and using them during process
170+
// shutdown. This appears to be fixed in Visual Studio 2015 and later.
165171
# define LOG4CPLUS_WITH_CXX11_THREADS
166172
# endif
167173
#endif

0 commit comments

Comments
 (0)
0