From: JINMEI Tatuya Date: Mon, 8 Oct 2012 23:56:10 +0000 (-0700) Subject: [2204] updated comments about releasing old data source client lists X-Git-Tag: trac2351_base~1^2~8^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e159ffca0b633c817472101087be4a235a42af0;p=thirdparty%2Fkea.git [2204] updated comments about releasing old data source client lists the previous one was not really accurate and was confusing. --- diff --git a/src/bin/auth/main.cc b/src/bin/auth/main.cc index 1e3ca9c3de..99080662ff 100644 --- a/src/bin/auth/main.cc +++ b/src/bin/auth/main.cc @@ -109,17 +109,16 @@ datasrcConfigHandler(AuthSrv* server, bool* first_time, lists = configureDataSource(config->get("classes")); } - // Replace the server's lists. By ignoring the return value we let the - // old lists be destroyed. Lock will be released immediately after the - // swap. + // Replace the server's lists. The returned lists will be stored + // in a local variable 'lists', and will be destroyed outside of + // the temporary block for the lock scope. That way we can minimize + // the range of the critical section. { isc::util::thread::Mutex::Locker locker( server->getDataSrcClientListMutex()); lists = server->swapDataSrcClientLists(lists); } - // The previous lists are destroyed here. Note that it's outside - // of the critical section protected by the locker. So this can - // take time if running on a separate thread. + // The previous lists are destroyed here. } }