Commit 53e956d8 authored by Francis Dupont's avatar Francis Dupont

[914-move-to-c-11-thread-library-in-core-library-code] Upgraded thread/mutex...

[914-move-to-c-11-thread-library-in-core-library-code] Upgraded thread/mutex code in the core library to C++11
parent 258f0c51
......@@ -54,7 +54,6 @@ kea_ctrl_agent_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
kea_ctrl_agent_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
kea_ctrl_agent_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
kea_ctrl_agent_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
kea_ctrl_agent_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
kea_ctrl_agent_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
kea_ctrl_agent_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
kea_ctrl_agent_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
......
......@@ -69,7 +69,6 @@ kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
kea_dhcp_ddns_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS)
......
......@@ -91,7 +91,6 @@ d2_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
d2_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
d2_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
d2_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
d2_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
d2_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
d2_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
d2_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS)
......
......@@ -73,7 +73,6 @@ kea_dhcp4_LDADD += $(top_builddir)/src/lib/process/libkea-process.la
kea_dhcp4_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
kea_dhcp4_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
kea_dhcp4_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
kea_dhcp4_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
kea_dhcp4_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
kea_dhcp4_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
kea_dhcp4_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS)
......
......@@ -159,7 +159,6 @@ dhcp4_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
dhcp4_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
dhcp4_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
dhcp4_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
dhcp4_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
dhcp4_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
dhcp4_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS)
......
......@@ -72,7 +72,6 @@ kea_dhcp6_LDADD += $(top_builddir)/src/lib/process/libkea-process.la
kea_dhcp6_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
kea_dhcp6_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
kea_dhcp6_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
kea_dhcp6_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
kea_dhcp6_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
kea_dhcp6_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
kea_dhcp6_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS)
......
......@@ -159,7 +159,6 @@ dhcp6_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
dhcp6_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS)
......
......@@ -54,7 +54,6 @@ kea_lfc_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
kea_lfc_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
kea_lfc_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
kea_lfc_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
kea_lfc_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
kea_lfc_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
kea_lfc_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
kea_lfc_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS)
......
......@@ -79,7 +79,6 @@ lfc_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
lfc_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
lfc_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
lfc_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
lfc_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
lfc_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
lfc_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
lfc_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS)
......
......@@ -54,7 +54,6 @@ libdhcp_ha_la_LIBADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
libdhcp_ha_la_LIBADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
libdhcp_ha_la_LIBADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
libdhcp_ha_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
libdhcp_ha_la_LIBADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libdhcp_ha_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
libdhcp_ha_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
......
......@@ -45,7 +45,6 @@ libdhcp_lease_cmds_la_LIBADD += $(top_builddir)/src/lib/stats/libkea-stats.la
libdhcp_lease_cmds_la_LIBADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
libdhcp_lease_cmds_la_LIBADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
libdhcp_lease_cmds_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
libdhcp_lease_cmds_la_LIBADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libdhcp_lease_cmds_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
libdhcp_lease_cmds_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
libdhcp_lease_cmds_la_LIBADD += $(LOG4CPLUS_LIBS)
......
......@@ -47,7 +47,6 @@ lease_cmds_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
lease_cmds_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
lease_cmds_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
lease_cmds_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
lease_cmds_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
lease_cmds_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
lease_cmds_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
lease_cmds_unittests_LDADD += $(LOG4CPLUS_LIBS)
......
......@@ -49,7 +49,6 @@ libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
......
......@@ -54,7 +54,6 @@ mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
mysql_cb_unittests_LDADD += $(LOG4CPLUS_LIBS)
......
......@@ -43,7 +43,6 @@ libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/stats/libkea-stats.la
libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
libdhcp_stat_cmds_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
libdhcp_stat_cmds_la_LIBADD += $(LOG4CPLUS_LIBS)
......
......@@ -58,7 +58,6 @@ stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.
stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
stat_cmds_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
stat_cmds_unittests_LDADD += $(LOG4CPLUS_LIBS)
......
......@@ -42,7 +42,6 @@ libdhcp_user_chk_la_LDFLAGS += -rpath /nowhere
libdhcp_user_chk_la_LIBADD = libduc.la
libdhcp_user_chk_la_LIBADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
libdhcp_user_chk_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
libdhcp_user_chk_la_LIBADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libdhcp_user_chk_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
libdhcp_user_chk_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
libdhcp_user_chk_la_LIBADD += $(LOG4CPLUS_LIBS)
......
......@@ -48,7 +48,6 @@ libdhcp_user_chk_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
libdhcp_user_chk_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
libdhcp_user_chk_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
libdhcp_user_chk_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
libdhcp_user_chk_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libdhcp_user_chk_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
libdhcp_user_chk_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
libdhcp_user_chk_unittests_LDADD += $(LOG4CPLUS_LIBS)
......
......@@ -24,7 +24,6 @@ libkea_asiodns_la_CPPFLAGS = $(AM_CPPFLAGS)
libkea_asiodns_la_LIBADD = $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
libkea_asiodns_la_LIBADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
libkea_asiodns_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
libkea_asiodns_la_LIBADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libkea_asiodns_la_LIBADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
libkea_asiodns_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
libkea_asiodns_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
......
......@@ -26,7 +26,6 @@ run_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
run_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
run_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
run_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
......
......@@ -37,7 +37,6 @@ run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
run_unittests_LDADD = $(top_builddir)/src/lib/asiolink/testutils/libasiolinktest.la
run_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
run_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
......
// Copyright (C) 2017-2018 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2017-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
......@@ -300,17 +300,18 @@ TestServerUnixSocket::accept() {
void
TestServerUnixSocket::signalRunning() {
{
isc::util::thread::Mutex::Locker lock(mutex_);
std::lock_guard<std::mutex> lock(mutex_);
running_ = true;
}
condvar_.signal();
condvar_.notify_one();
}
void
TestServerUnixSocket::waitForRunning() {
isc::util::thread::Mutex::Locker lock(mutex_);
std::lock_guard<std::mutex> locker(mutex_);
std::unique_lock<std::mutex> lock(mutex_, std::adopt_lock);
while (!running_) {
condvar_.wait(mutex_);
condvar_.wait(lock);
}
}
......
// Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2017-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
......@@ -10,13 +10,13 @@
#include <config.h>
#include <asiolink/interval_timer.h>
#include <asiolink/io_service.h>
#include <util/threads/thread.h>
#include <util/threads/sync.h>
#include <boost/shared_ptr.hpp>
#include <gtest/gtest.h>
#include <list>
#include <stdint.h>
#include <string>
#include <mutex>
#include <condition_variable>
namespace isc {
namespace asiolink {
......@@ -151,14 +151,14 @@ private:
/// Mutex is used in situations when server's IO service is being run in a
/// thread to synchronize this thread with a main thread using
/// @ref signalRunning and @ref waitForRunning.
isc::util::thread::Mutex mutex_;
std::mutex mutex_;
/// @brief Conditional variable used by the server.
///
/// Conditional variable is used in situations when server's IO service is
/// being run in a thread to synchronize this thread with a main thread
/// using @ref signalRunning and @ref waitForRunning.
isc::util::thread::CondVar condvar_;
std::condition_variable condvar_;
};
/// @brief Pointer to the @ref TestServerUnixSocket.
......
......@@ -31,7 +31,6 @@ run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
run_unittests_LDADD = $(top_builddir)/src/lib/cc/libkea-cc.la
run_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
run_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
......
SUBDIRS = . tests
UBDIRS = . tests
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += $(BOOST_INCLUDES)
......@@ -22,7 +22,6 @@ libkea_cfgclient_la_LIBADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
libkea_cfgclient_la_LIBADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
libkea_cfgclient_la_LIBADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
libkea_cfgclient_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
libkea_cfgclient_la_LIBADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libkea_cfgclient_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
libkea_cfgclient_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
libkea_cfgclient_la_LIBADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS)
......
......@@ -35,7 +35,6 @@ run_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
run_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
run_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
run_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
......
......@@ -29,7 +29,6 @@ libcb_unittests_LDADD = $(top_builddir)/src/lib/database/libkea-database.la
libcb_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
libcb_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
libcb_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
libcb_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libcb_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
libcb_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
libcb_unittests_LDADD += $(LOG4CPLUS_LIBS) $(BOOST_LIBS) $(GTEST_LDADD)
......
......@@ -16,7 +16,6 @@ libkea_cql_la_LIBADD = $(top_builddir)/src/lib/database/libkea-database.la
libkea_cql_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la
libkea_cql_la_LIBADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
libkea_cql_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
libkea_cql_la_LIBADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libkea_cql_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
libkea_cql_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
libkea_cql_la_LIBADD += $(LOG4CPLUS_LIBS) $(BOOST_LIBS)
......
......@@ -25,7 +25,6 @@ libkea_database_la_SOURCES += server_selector.cc server_selector.h
libkea_database_la_LIBADD = $(top_builddir)/src/lib/cc/libkea-cc.la
libkea_database_la_LIBADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
libkea_database_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
libkea_database_la_LIBADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libkea_database_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
libkea_database_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
libkea_database_la_LIBADD += $(LOG4CPLUS_LIBS) $(BOOST_LIBS)
......
......@@ -35,7 +35,6 @@ libdatabase_unittests_LDADD += $(top_builddir)/src/lib/testutils/libkea-testutil
libdatabase_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
libdatabase_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
libdatabase_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
libdatabase_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libdatabase_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
libdatabase_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
libdatabase_unittests_LDADD += $(LOG4CPLUS_LIBS) $(BOOST_LIBS) $(GTEST_LDADD)
......
......@@ -78,7 +78,6 @@ libkea_dhcp___la_LIBADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
libkea_dhcp___la_LIBADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
libkea_dhcp___la_LIBADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
libkea_dhcp___la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
libkea_dhcp___la_LIBADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libkea_dhcp___la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
libkea_dhcp___la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la
libkea_dhcp___la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
......
......@@ -42,7 +42,6 @@
using namespace std;
using namespace isc::asiolink;
using namespace isc::util;
using namespace isc::util::thread;
using namespace isc::util::io;
using namespace isc::util::io::internal;
......
......@@ -18,7 +18,7 @@
#include <dhcp/pkt_filter6.h>
#include <util/optional.h>
#include <util/watch_socket.h>
#include <util/threads/watched_thread.h>
#include <util/watched_thread.h>
#include <boost/function.hpp>
#include <boost/noncopyable.hpp>
......@@ -1385,7 +1385,7 @@ private:
PacketQueueMgr6Ptr packet_queue_mgr6_;
/// DHCP packet receiver.
isc::util::thread::WatchedThreadPtr dhcp_receiver_;
isc::util::WatchedThreadPtr dhcp_receiver_;
};
}; // namespace isc::dhcp
......
// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
......@@ -11,7 +11,6 @@
#include <dhcp/socket_info.h>
#include <dhcp/pkt4.h>
#include <dhcp/pkt6.h>
#include <util/threads/sync.h>
#include <boost/function.hpp>
#include <boost/circular_buffer.hpp>
......
// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
......@@ -8,11 +8,11 @@
#define PACKET_QUEUE_RING_H
#include <dhcp/packet_queue.h>
#include <util/threads/sync.h>
#include <boost/function.hpp>
#include <boost/circular_buffer.hpp>
#include <sstream>
#include <mutex>
namespace isc {
......@@ -105,7 +105,7 @@ public:
/// @param to specifies the end of the queue to which the packet
/// should be added.
virtual void pushPacket(PacketTypePtr& packet, const QueueEnd& to=QueueEnd::BACK) {
isc::util::thread::Mutex::Locker lock(mutex_);
std::lock_guard<std::mutex> lock(mutex_);
if (to == QueueEnd::BACK) {
queue_.push_back(packet);
} else {
......@@ -123,12 +123,12 @@ public:
/// @return A pointer to dequeued packet, or an empty pointer
/// if the queue is empty.
virtual PacketTypePtr popPacket(const QueueEnd& from = QueueEnd::FRONT) {
isc::util::thread::Mutex::Locker lock(mutex_);
PacketTypePtr packet;
if (queue_.empty()) {
return (packet);
}
std::lock_guard<std::mutex> lock(mutex_);
if (from == QueueEnd::FRONT) {
packet = queue_.front();
queue_.pop_front();
......@@ -210,7 +210,7 @@ private:
boost::circular_buffer<PacketTypePtr> queue_;
/// @brief Mutex for protecting queue accesses.
isc::util::thread::Mutex mutex_;
std::mutex mutex_;
};
......
......@@ -112,7 +112,6 @@ libdhcp___unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
libdhcp___unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
libdhcp___unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
libdhcp___unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
libdhcp___unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libdhcp___unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
libdhcp___unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
libdhcp___unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
......
......@@ -32,7 +32,6 @@ libkea_dhcp_ddns_la_LIBADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
libkea_dhcp_ddns_la_LIBADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
libkea_dhcp_ddns_la_LIBADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
libkea_dhcp_ddns_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
libkea_dhcp_ddns_la_LIBADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libkea_dhcp_ddns_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
libkea_dhcp_ddns_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
libkea_dhcp_ddns_la_LIBADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS)
......
......@@ -40,7 +40,6 @@ libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
libdhcp_ddns_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS)
......
......@@ -205,7 +205,6 @@ libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
libkea_dhcpsrv_la_LIBADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS)
......
......@@ -97,7 +97,6 @@ run_benchmarks_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
run_benchmarks_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
run_benchmarks_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
run_benchmarks_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
run_benchmarks_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
run_benchmarks_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
run_benchmarks_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
......
......@@ -187,7 +187,6 @@ libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.l
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
libdhcpsrv_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS)
......
......@@ -32,7 +32,6 @@ libkea_eval_la_LIBADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
libkea_eval_la_LIBADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
libkea_eval_la_LIBADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
libkea_eval_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
libkea_eval_la_LIBADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libkea_eval_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
libkea_eval_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
libkea_eval_la_LIBADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS)
......
......@@ -37,7 +37,6 @@ libeval_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
libeval_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
libeval_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
libeval_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
libeval_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libeval_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
libeval_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
libeval_unittests_LDADD += $(top_builddir)/src/lib/testutils/libkea-testutils.la
......
......@@ -41,7 +41,6 @@ libkea_hooks_la_CPPFLAGS = $(AM_CPPFLAGS)
libkea_hooks_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined -version-info 7:3:0
libkea_hooks_la_LIBADD =
libkea_hooks_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
libkea_hooks_la_LIBADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libkea_hooks_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
libkea_hooks_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la
libkea_hooks_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
......
......@@ -8,11 +8,10 @@ AM_CXXFLAGS = $(KEA_CXXFLAGS)
# Kea libraries against which the test user libraries are linked.
HOOKS_LIB = $(top_builddir)/src/lib/hooks/libkea-hooks.la
LOG_LIB = $(top_builddir)/src/lib/log/libkea-log.la
THREADS_LIB = $(top_builddir)/src/lib/util/threads/libkea-threads.la
UTIL_LIB = $(top_builddir)/src/lib/util/libkea-util.la
EXCEPTIONS_LIB = $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
ALL_LIBS = $(HOOKS_LIB) $(LOG_LIB) $(THREADS_LIB) $(UTIL_LIB) $(EXCEPTIONS_LIB) $(LOG4CPLUS_LIBS)
ALL_LIBS = $(HOOKS_LIB) $(LOG_LIB) $(UTIL_LIB) $(EXCEPTIONS_LIB) $(LOG4CPLUS_LIBS)
# Files to clean include the file created by testing.
CLEANFILES = *.gcno *.gcda $(builddir)/marker_file.dat
......
......@@ -46,7 +46,6 @@ libkea_http_la_LIBADD =
libkea_http_la_LIBADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
libkea_http_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la
libkea_http_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
libkea_http_la_LIBADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libkea_http_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
libkea_http_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
libkea_http_la_LIBADD += $(LOG4CPLUS_LIBS) $(BOOST_LIBS)
......
......@@ -45,7 +45,6 @@ libhttp_unittests_LDADD = $(top_builddir)/src/lib/http/libkea-http.la
libhttp_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
libhttp_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
libhttp_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
libhttp_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libhttp_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
libhttp_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
libhttp_unittests_LDADD += $(LOG4CPLUS_LIBS)
......
......@@ -46,7 +46,6 @@ libkea_log_la_CXXFLAGS += -Wno-unused-parameter -Wno-deprecated-declarations
endif
libkea_log_la_CPPFLAGS = $(AM_CPPFLAGS) $(LOG4CPLUS_INCLUDES)
libkea_log_la_LIBADD = $(top_builddir)/src/lib/log/interprocess/libkea-log_interprocess.la
libkea_log_la_LIBADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libkea_log_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
libkea_log_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
libkea_log_la_LIBADD += $(LOG4CPLUS_LIBS)
......
......@@ -17,7 +17,6 @@ bin_PROGRAMS = kea-msg-compiler
kea_msg_compiler_SOURCES = message.cc
kea_msg_compiler_LDADD = $(top_builddir)/src/lib/log/libkea-log.la
kea_msg_compiler_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
kea_msg_compiler_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
kea_msg_compiler_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
kea_msg_compiler_LDADD += $(LOG4CPLUS_LIBS)
......
// Copyright (C) 2011-2017 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2011-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
......@@ -152,7 +152,7 @@ void
LoggerImpl::outputRaw(const Severity& severity, const string& message) {
// Use a mutex locker for mutual exclusion from other threads in
// this process.
isc::util::thread::Mutex::Locker mutex_locker(LoggerManager::getMutex());
std::lock_guard<std::mutex> mutex_locker(LoggerManager::getMutex());
// Use an interprocess sync locker for mutual exclusion from other
// processes to avoid log messages getting interspersed.
......
......@@ -206,9 +206,9 @@ LoggerManager::reset() {
LoggerManagerImpl::reset(initSeverity(), initDebugLevel());
}
isc::util::thread::Mutex&
std::mutex&
LoggerManager::getMutex() {
static isc::util::thread::Mutex mutex;
static std::mutex mutex;
return (mutex);
}
......
// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2011-2019 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
......@@ -8,11 +8,12 @@
#define LOGGER_MANAGER_H
#include <exceptions/exceptions.h>
#include <util/threads/sync.h>
#include <log/logger_specification.h>
#include <boost/noncopyable.hpp>
#include <mutex>
// Generated if, when updating the logging specification, an unknown
// destination is encountered.
class UnknownLoggingDestination : public isc::Exception {
......@@ -138,7 +139,7 @@ public:
/// \brief Return a process-global mutex that's used for mutual
/// exclusion among threads of a single process during logging
/// calls.
static isc::util::thread::Mutex& getMutex();
static std::mutex& getMutex();
private:
/// \brief Initialize Processing
......
......@@ -23,7 +23,6 @@ logger_example_SOURCES = logger_example.cc
logger_example_CPPFLAGS = $(AM_CPPFLAGS)
logger_example_LDFLAGS = $(AM_LDFLAGS)
logger_example_LDADD = $(top_builddir)/src/lib/log/libkea-log.la
logger_example_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
logger_example_LDADD += $(top_builddir)/src/lib/util/libkea-util.la