]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2204] updated comments about releasing old data source client lists
authorJINMEI Tatuya <jinmei@isc.org>
Mon, 8 Oct 2012 23:56:10 +0000 (16:56 -0700)
committerJINMEI Tatuya <jinmei@isc.org>
Mon, 8 Oct 2012 23:56:10 +0000 (16:56 -0700)
the previous one was not really accurate and was confusing.

src/bin/auth/main.cc

index 1e3ca9c3de3813b4b27b6ff1ece748c65276f92a..99080662ff86ef3ee8dd3766ec20a71cac5d750c 100644 (file)
@@ -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.
     }
 }