BIND 10 trac2211, updated. bb59b815c94d86c6d5d34cdfd707b7e6e3522122 [2211] added notes about ownership on the returned value of findClientList().
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Oct 22 19:09:39 UTC 2012
The branch, trac2211 has been updated
via bb59b815c94d86c6d5d34cdfd707b7e6e3522122 (commit)
via e13d083a39e86bcb60867b281ccd0a045bb55993 (commit)
via 07b436b864bd3193ecafbfe1f9c1fa54f90ac342 (commit)
from 6cf94944f1431422449f5740299ee2d6ae5fd988 (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 bb59b815c94d86c6d5d34cdfd707b7e6e3522122
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Mon Oct 22 12:08:42 2012 -0700
[2211] added notes about ownership on the returned value of findClientList().
commit e13d083a39e86bcb60867b281ccd0a045bb55993
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Mon Oct 22 11:26:00 2012 -0700
[2211] wording/grammer fixes to documentation and comments.
commit 07b436b864bd3193ecafbfe1f9c1fa54f90ac342
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Mon Oct 22 10:55:53 2012 -0700
[2211] use swap instead of splice. for this purpose it's enough and simpler.
-----------------------------------------------------------------------
Summary of changes:
src/bin/auth/auth_srv.cc | 2 +-
src/bin/auth/datasrc_clients_mgr.h | 18 +++++++++++++-----
src/bin/auth/tests/datasrc_clients_mgr_unittest.cc | 2 +-
3 files changed, 15 insertions(+), 7 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/auth/auth_srv.cc b/src/bin/auth/auth_srv.cc
index e282444..157ae03 100644
--- a/src/bin/auth/auth_srv.cc
+++ b/src/bin/auth/auth_srv.cc
@@ -631,7 +631,7 @@ AuthSrvImpl::processNormalQuery(const IOMessage& io_message, Message& message,
local_edns->setUDPSize(AuthSrvImpl::DEFAULT_LOCAL_UDPSIZE);
message.setEDNS(local_edns);
}
- // Get access to data source client list through the holder and keep thek
+ // Get access to data source client list through the holder and keep the
// holder until the processing and rendering is done to avoid inter-thread
// race.
auth::DataSrcClientsMgr::Holder datasrc_holder(datasrc_clients_mgr_);
diff --git a/src/bin/auth/datasrc_clients_mgr.h b/src/bin/auth/datasrc_clients_mgr.h
index 01c346f..1d5c17c 100644
--- a/src/bin/auth/datasrc_clients_mgr.h
+++ b/src/bin/auth/datasrc_clients_mgr.h
@@ -116,6 +116,15 @@ public:
/// otherwise it returns NULL. The manager keeps the ownership of
/// the pointed object. Also, it's not safe to get access to the
/// object beyond the scope of the holder object.
+ ///
+ /// \note Since the ownership isn't transferred the return value
+ /// could be a bare pointer (and it's probably better in several
+ /// points). Unfortunately, some unit tests currently don't work
+ /// unless this method effectively shares the ownership with the
+ /// tests. That's the only reason why we return a shared pointer
+ /// for now. We should eventually fix it and change the return value
+ /// type (see Trac ticket #2395). Other applications must not
+ /// assume the ownership is actually shared.
boost::shared_ptr<datasrc::ConfigurableClientList> findClientList(
const dns::RRClass& rrclass)
{
@@ -195,8 +204,8 @@ public:
///
/// This method simply passes the new configuration to the builder
/// and immediately returns. This method is basically exception free
- /// as long as the caller a non NULL value for \c config_arg; it doesn't
- /// validate the argument further.
+ /// as long as the caller passes a non NULL value for \c config_arg;
+ /// it doesn't validate the argument further.
///
/// \brief isc::InvalidParameter config_arg is NULL.
/// \brief std::bad_alloc
@@ -356,13 +365,12 @@ DataSrcClientsBuilderBase<MutexType, CondVarType>::run() {
std::list<Command> current_commands;
{
// Move all new commands to local queue under the protection of
- // queue_mutex_. Note that list::splice() should never throw.
+ // queue_mutex_.
typename MutexType::Locker locker(*queue_mutex_);
while (command_queue_->empty()) {
cond_->wait(*queue_mutex_);
}
- current_commands.splice(current_commands.end(),
- *command_queue_);
+ current_commands.swap(*command_queue_);
} // the lock is release here.
while (keep_running && !current_commands.empty()) {
diff --git a/src/bin/auth/tests/datasrc_clients_mgr_unittest.cc b/src/bin/auth/tests/datasrc_clients_mgr_unittest.cc
index 3fefda0..a5d4928 100644
--- a/src/bin/auth/tests/datasrc_clients_mgr_unittest.cc
+++ b/src/bin/auth/tests/datasrc_clients_mgr_unittest.cc
@@ -50,7 +50,7 @@ shutdownCheck() {
EXPECT_TRUE(FakeDataSrcClientsBuilder::thread_waited);
}
-// Commonly used patter of checking member variables shared between the
+// Commonly used pattern of checking member variables shared between the
// manager and builder.
void
checkSharedMembers(size_t expected_queue_lock_count,
More information about the bind10-changes
mailing list