From 3259f681a4336ca26676a941d71cbfe908fdccbc Mon Sep 17 00:00:00 2001 From: Michael Glassford Date: Thu, 19 Feb 2004 01:10:56 +0000 Subject: [PATCH] Merge fixes from main branch. [SVN r22321] --- example/Jamfile | 3 +-- src/recursive_mutex.cpp | 14 ++++++++++---- test/Jamfile | 6 ++---- tutorial/Jamfile | 3 +-- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/example/Jamfile b/example/Jamfile index aab4d6f9..66f67f27 100644 --- a/example/Jamfile +++ b/example/Jamfile @@ -27,8 +27,7 @@ subproject libs/thread/example ; # Include threads.jam for Boost.Threads global build information. # This greatly simplifies the Jam code needed to configure the build # for the various Win32 build types. -SEARCH on threads.jam = $(BOOST_ROOT)/libs/thread/build ; -include threads.jam ; +import ../build/threads ; { template example diff --git a/src/recursive_mutex.cpp b/src/recursive_mutex.cpp index a3c947b2..0707df96 100644 --- a/src/recursive_mutex.cpp +++ b/src/recursive_mutex.cpp @@ -23,17 +23,23 @@ #elif defined(BOOST_HAS_PTHREADS) # include #elif defined(BOOST_HAS_MPTASKS) -# include -# include "safe.hpp" +# include +# include "safe.hpp" #endif namespace boost { #if defined(BOOST_HAS_WINTHREADS) recursive_mutex::recursive_mutex() - : m_count(0) + : m_mutex(0), m_count(0) { - m_mutex = reinterpret_cast(new(std::nothrow) CRITICAL_SECTION); + try + { + m_mutex = reinterpret_cast(new CRITICAL_SECTION); + } + catch (...) + { + } if (!m_mutex) throw thread_resource_error(); InitializeCriticalSection(reinterpret_cast(m_mutex)); diff --git a/test/Jamfile b/test/Jamfile index c89a885f..bc64bf7a 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -27,12 +27,10 @@ subproject libs/thread/test ; # Include threads.jam for Boost.Threads global build information. # This greatly simplifies the Jam code needed to configure the build # for the various Win32 build types. -SEARCH on threads.jam = $(BOOST_ROOT)/libs/thread/build ; -include threads.jam ; +import ../build/threads ; # bring in rules for testing -SEARCH on testing.jam = $(BOOST_BUILD_PATH) ; -include testing.jam ; +import testing ; { template test diff --git a/tutorial/Jamfile b/tutorial/Jamfile index e52bafc3..ee808874 100644 --- a/tutorial/Jamfile +++ b/tutorial/Jamfile @@ -28,8 +28,7 @@ subproject libs/thread/tutorial ; # Include threads.jam for Boost.Threads global build information. # This greatly simplifies the Jam code needed to configure the build # for the various Win32 build types. -SEARCH on threads.jam = $(BOOST_ROOT)/libs/thread/build ; -include threads.jam ; +import ../build/threads ; { template tutorial