BIND 10 master, updated. a0a39d4b6e67fe575206ae191ddadc2f6f29e35c Merge branch 'master' into trac1680
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Mar 6 01:22:56 UTC 2012
The branch, master has been updated
via a0a39d4b6e67fe575206ae191ddadc2f6f29e35c (commit)
via a2a9e24d6a5744ab6b916c8e94ab0b77137417f2 (commit)
via 9c4d0cadf4adc802cc41a2610dc2c30b25aad728 (commit)
from cb40afcbf13f2f456f5e671c755db9457c04e012 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a0a39d4b6e67fe575206ae191ddadc2f6f29e35c
Merge: a2a9e24d6a5744ab6b916c8e94ab0b77137417f2 cb40afcbf13f2f456f5e671c755db9457c04e012
Author: haikuo zhang <zhanghaikuo at cnnic.cn>
Date: Mon Mar 5 18:22:46 2012 +0800
Merge branch 'master' into trac1680
commit a2a9e24d6a5744ab6b916c8e94ab0b77137417f2
Author: haikuo zhang <zhanghaikuo at cnnic.cn>
Date: Mon Mar 5 18:11:49 2012 +0800
[1680] remove codes which should be build in --enable-boost-threads
switch. the codes are in src/lib/util/locks.h
commit 9c4d0cadf4adc802cc41a2610dc2c30b25aad728
Author: haikuo zhang <zhanghaikuo at cnnic.cn>
Date: Thu Mar 1 15:39:07 2012 +0800
[1680] remove --enable-boost-threads from configure.
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 67 ---------------------------------------
src/lib/cache/tests/Makefile.am | 5 ---
src/lib/nsas/tests/Makefile.am | 5 ---
src/lib/util/locks.h | 58 +--------------------------------
4 files changed, 2 insertions(+), 133 deletions(-)
-----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index af8c2fe..72a462f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,11 +85,6 @@ if test $enable_shared = no; then
AC_MSG_ERROR([BIND 10 requires shared libraries to be built])
fi
-AC_ARG_ENABLE(boost-threads,
-AC_HELP_STRING([--enable-boost-threads],
- [use boost threads. Currently this only means using its locks instead of dummy locks, in the cache and NSAS]),
- use_boost_threads=$enableval, use_boost_threads=no)
-
# allow configuring without setproctitle.
AC_ARG_ENABLE(setproctitle-check,
AC_HELP_STRING([--disable-setproctitle-check],
@@ -680,68 +675,6 @@ AC_CHECK_HEADERS([boost/shared_ptr.hpp boost/foreach.hpp boost/interprocess/sync
CPPFLAGS="$CPPFLAGS_SAVES"
AC_SUBST(BOOST_INCLUDES)
-
-if test "${use_boost_threads}" = "yes" ; then
- AC_DEFINE([USE_BOOST_THREADS], [], [Use boost threads])
-
- # Using boost::mutex can result in requiring libboost_thread with older
- # versions of Boost. We'd like to avoid relying on a compiled Boost library
- # whenever possible, so we need to check for it step by step.
- #
- # NOTE: another fix of this problem is to simply require newer versions of
- # boost. If we choose that solution we should simplify the following tricky
- # checks accordingly and all Makefile.am's that refer to NEED_LIBBOOST_THREAD.
- AC_MSG_CHECKING(for boost::mutex)
- CPPFLAGS_SAVES="$CPPFLAGS"
- LIBS_SAVES="$LIBS"
- CPPFLAGS="$BOOST_INCLUDES $CPPFLAGS $MULTITHREADING_FLAG"
- need_libboost_thread=0
- need_sunpro_workaround=0
- AC_TRY_LINK([
- #include <boost/thread.hpp>
- ],[
- boost::mutex m;
- ],
- [ AC_MSG_RESULT(yes (without libboost_thread)) ],
- # there is one specific problem with SunStudio 5.10
- # where including boost/thread causes a compilation failure
- # There is a workaround in boost but it checks the version not being 5.10
- # This will probably be fixed in the future, in which case this
- # is only a temporary workaround
- [ AC_TRY_LINK([
- #if defined(__SUNPRO_CC) && __SUNPRO_CC == 0x5100
- #undef __SUNPRO_CC
- #define __SUNPRO_CC 0x5090
- #endif
- #include <boost/thread.hpp>
- ],[
- boost::mutex m;
- ],
- [ AC_MSG_RESULT(yes (with SUNOS workaround))
- need_sunpro_workaround=1 ],
- [ LIBS=" $LIBS -lboost_thread"
- AC_TRY_LINK([
- #include <boost/thread.hpp>
- ],[
- boost::mutex m;
- ],
- [ AC_MSG_RESULT(yes (with libboost_thread))
- need_libboost_thread=1 ],
- [ AC_MSG_RESULT(no)
- AC_MSG_ERROR([boost::mutex cannot be linked in this build environment.
- Perhaps you are using an older version of Boost that requires libboost_thread for the mutex support, which does not appear to be available.
- You may want to check the availability of the library or to upgrade Boost.])
- ])])])
- CPPFLAGS="$CPPFLAGS_SAVES"
- LIBS="$LIBS_SAVES"
- AM_CONDITIONAL(NEED_LIBBOOST_THREAD, test $need_libboost_thread = 1)
- if test $need_sunpro_workaround = 1; then
- AC_DEFINE([NEED_SUNPRO_WORKAROUND], [], [Need boost sunstudio workaround])
- fi
-else
- AM_CONDITIONAL(NEED_LIBBOOST_THREAD, test "${use_boost_threads}" = "yes")
-fi
-
# I can't get some of the #include <asio.hpp> right without this
# TODO: find the real cause of asio/boost wanting pthreads
# (this currently only occurs for src/lib/cc/session_unittests)
diff --git a/src/lib/cache/tests/Makefile.am b/src/lib/cache/tests/Makefile.am
index a215c56..b638f55 100644
--- a/src/lib/cache/tests/Makefile.am
+++ b/src/lib/cache/tests/Makefile.am
@@ -47,11 +47,6 @@ run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
run_unittests_LDADD = $(GTEST_LDADD)
-# NOTE: we may have to clean up this hack later (see the note in configure.ac)
-if NEED_LIBBOOST_THREAD
-run_unittests_LDADD += -lboost_thread
-endif
-
run_unittests_LDADD += $(top_builddir)/src/lib/cache/libcache.la
run_unittests_LDADD += $(top_builddir)/src/lib/log/liblog.la
run_unittests_LDADD += $(top_builddir)/src/lib/nsas/libnsas.la
diff --git a/src/lib/nsas/tests/Makefile.am b/src/lib/nsas/tests/Makefile.am
index 420e897..afd91f6 100644
--- a/src/lib/nsas/tests/Makefile.am
+++ b/src/lib/nsas/tests/Makefile.am
@@ -46,11 +46,6 @@ run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
run_unittests_LDADD = $(GTEST_LDADD)
-# NOTE: we may have to clean up this hack later (see the note in configure.ac)
-if NEED_LIBBOOST_THREAD
-run_unittests_LDADD += -lboost_thread
-endif
-
run_unittests_LDADD += $(top_builddir)/src/lib/nsas/libnsas.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la
run_unittests_LDADD += $(top_builddir)/src/lib/log/liblog.la
diff --git a/src/lib/util/locks.h b/src/lib/util/locks.h
index 971c413..daaf216 100644
--- a/src/lib/util/locks.h
+++ b/src/lib/util/locks.h
@@ -15,13 +15,9 @@
/// This file (right now) provides dummy locks
/// It also contains code to use boost/threads locks:
///
-/// if USE_BOOST_THREADS is defined, we typedef the relevant classes
-/// and derive from the relevant templates so our dummy locks are
-/// replaced by the boost locks (--enable-boost-threads)
///
-/// If USE_BOOST_THREADS is NOT defined, all locks are dummy classes
-/// that don't actually do anything. At this moment, only the very
-/// minimal set of methods that we actually use is defined.
+/// All locks are dummy classes that don't actually do anything. At this moment,
+/// only the very minimal set of methods that we actually use is defined.
///
/// Note that we need to include <config.h> in our .cc files for that
/// to be set. we might want to enfore this at compile time with a check
@@ -30,8 +26,6 @@
#ifndef __LOCKS_
#define __LOCKS_
-#ifndef USE_BOOST_THREADS
-
namespace isc {
namespace util {
namespace locks {
@@ -64,52 +58,4 @@ public:
} // namespace util
} // namespace isc
-#else // USE_BOOST_THREADS
-
-// Workaround for a problem with boost and sunstudio 5.10
-// There is a version check in there that appears wrong,
-// which makes including boost/thread.hpp fail
-// This will probably be fixed in a future version of boost,
-// in which case this part can be removed then
-#ifdef NEED_SUNPRO_WORKAROUND
-#if defined(__SUNPRO_CC) && __SUNPRO_CC == 0x5100
-#undef __SUNPRO_CC
-#define __SUNPRO_CC 0x5090
-#endif
-#endif // NEED_SUNPRO_WORKAROUND
-
-#include <boost/thread.hpp>
-#include <boost/interprocess/sync/sharable_lock.hpp>
-#include <boost/interprocess/sync/scoped_lock.hpp>
-#include <boost/interprocess/sync/interprocess_upgradable_mutex.hpp>
-#include <boost/interprocess/sync/interprocess_recursive_mutex.hpp>
-
-namespace isc {
-namespace util {
-namespace locks {
-
-typedef boost::mutex mutex;
-typedef boost::interprocess::interprocess_upgradable_mutex upgradable_mutex;
-typedef boost::interprocess::interprocess_recursive_mutex recursive_mutex;
-
-template <typename T>
-struct sharable_lock : public boost::interprocess::sharable_lock<T> {
-public:
- sharable_lock(T& mtype) : boost::interprocess::sharable_lock<T>(mtype) {}
-};
-
-
-template <class T>
-struct scoped_lock : public boost::interprocess::scoped_lock<T> {
-public:
- scoped_lock(T& mtype) : boost::interprocess::scoped_lock<T>(mtype) { }
-};
-
-} // namespace locks
-} // namespace util
-} // namespace isc
-
-
-#endif // USE_BOOST_THREADS
-
#endif // __LOCKS_
More information about the bind10-changes
mailing list