]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
make allocation engine thread safe
authorRazvan Becheriu <razvan@isc.org>
Tue, 9 Apr 2019 14:54:16 +0000 (17:54 +0300)
committerRazvan Becheriu <razvan@isc.org>
Fri, 12 Apr 2019 12:24:41 +0000 (15:24 +0300)
src/lib/dhcpsrv/alloc_engine.cc
src/lib/dhcpsrv/alloc_engine.h

index 7317389adab675ccc1027497336cc599fe9d1411..010d1187f922c902885dc227daf008319f59fd3e 100644 (file)
@@ -25,6 +25,7 @@
 #include <dhcpsrv/callout_handle_store.h>
 #include <stats/stats_mgr.h>
 #include <util/stopwatch.h>
+#include <util/threads/lock_guard.h>
 #include <hooks/server_hooks.h>
 #include <hooks/hooks_manager.h>
 
index 1edc9b1e4d5903a87316fd8e08657203d07f4285..03314b3285655b4817bf70d8a6b90cebb8fa45ad 100644 (file)
@@ -181,6 +181,9 @@ protected:
         static isc::asiolink::IOAddress
         increaseAddress(const isc::asiolink::IOAddress& address,
                         bool prefix, const uint8_t prefix_len);
+
+    private:
+        std::mutex mutex_;
     };
 
     /// @brief Address/prefix allocator that gets an address based on a hash