commit 4208411847b356aee45353b47c450e66531d052f
Author: Robert Haschke <rhaschke@techfak.uni-bielefeld.de>
Date:   Mon Oct 26 20:17:52 2020 +0100

    Modernize: boost::[thread|mutex] -> std::[thread|mutex]

diff --git a/client/cpp/include/MiddlewareRSB.h b/client/cpp/include/MiddlewareRSB.h
index a724ae6..cba1c58 100644
--- a/client/cpp/include/MiddlewareRSB.h
+++ b/client/cpp/include/MiddlewareRSB.h
@@ -81,12 +81,12 @@ private:
 	rsb::ListenerPtr inprotk_listener;
 	rsb::ListenerPtr hack_listener;
 
-	boost::mutex pending_tasks_mutex;
+	std::mutex pending_tasks_mutex;
 	std::vector<boost::shared_ptr<rst::communicationpatterns::TaskState> > pending_tasks;
 	unsigned int say_task_active;
 	unsigned int say_task_done;
 
-	boost::mutex current_saytask_mutex;
+	std::mutex current_saytask_mutex;
 	std::string current_saytask;
 	std::string get_current_saytask();
 	void set_current_saytask(std::string text);
diff --git a/server/include/Arbiter.h b/server/include/Arbiter.h
index 139ddd0..b294205 100644
--- a/server/include/Arbiter.h
+++ b/server/include/Arbiter.h
@@ -30,7 +30,7 @@
 #include <string>
 #include <vector>
 #include <boost/shared_ptr.hpp>
-#include <boost/thread/mutex.hpp>
+#include <mutex>
 #include <humotion/client/client.h>
 #include "EmotionState.h"
 #include "EmotionConfig.h"
@@ -88,19 +88,19 @@ private:
 	humotion::GazeState requested_gaze_state;
 	humotion::MouthState requested_mouth_state;
 
-	boost::mutex emotion_config_default_mutex;
-	boost::mutex emotion_config_current_mutex;
-	boost::mutex mouth_config_override_mutex;
-	boost::mutex utterance_mutex;
-	boost::mutex requested_gaze_state_mutex;
-	boost::mutex requested_mouth_state_mutex;
-	boost::mutex audio_player_mutex;
+	std::mutex emotion_config_default_mutex;
+	std::mutex emotion_config_current_mutex;
+	std::mutex mouth_config_override_mutex;
+	std::mutex utterance_mutex;
+	std::mutex requested_gaze_state_mutex;
+	std::mutex requested_mouth_state_mutex;
+	std::mutex audio_player_mutex;
 
-	boost::mutex animation_mutex;
+	std::mutex animation_mutex;
 	Animation active_animation;
 
 	typedef std::vector<boost::shared_ptr<Animation>> active_animation_vector_t;
-	boost::mutex active_animation_vector_mutex;
+	std::mutex active_animation_vector_mutex;
 	active_animation_vector_t active_animation_vector;
 
 	AudioPlayer* audio_player;
diff --git a/server/src/Arbiter.cpp b/server/src/Arbiter.cpp
index b052601..4d201f5 100644
--- a/server/src/Arbiter.cpp
+++ b/server/src/Arbiter.cpp
@@ -30,7 +30,8 @@
 #include "AudioPlayerLibAO.h"
 #include "AudioPlayerRSB.h"
 #include <boost/algorithm/string/predicate.hpp>
-#include <boost/thread/mutex.hpp>
+#include <mutex>
+#include <thread>
 #include <iostream>
 
 using namespace boost;
@@ -71,7 +72,7 @@ Arbiter::~Arbiter() {
 
 void Arbiter::set_default_emotion(EmotionState e) {
 	// lock access
-	boost::mutex::scoped_lock scoped_lock(emotion_config_default_mutex);
+	const std::lock_guard<std::mutex> lock(emotion_config_default_mutex);
 
 	// update our config, ignore duration as this is the default emotion
 	emotion_config_default.select_config(e.value);
@@ -84,7 +85,7 @@ void Arbiter::set_default_emotion(EmotionState e) {
 
 void Arbiter::set_current_emotion(EmotionState e) {
 	// lock access
-	boost::mutex::scoped_lock scoped_lock(emotion_config_current_mutex);
+	const std::lock_guard<std::mutex> lock(emotion_config_current_mutex);
 
 	// this will set a emotion override for a given time, after the timeout
 	// we will return to the default emotion state:
@@ -99,21 +100,21 @@ void Arbiter::set_current_emotion(EmotionState e) {
 
 void Arbiter::set_mouth_config(MouthConfig m) {
 	// lock access
-	boost::mutex::scoped_lock scoped_lock(mouth_config_override_mutex);
+	const std::lock_guard<std::mutex> lock(mouth_config_override_mutex);
 
 	mouth_config = m;
 }
 
 void Arbiter::set_gaze_target(humotion::GazeState target) {
 	// lock access
-	boost::mutex::scoped_lock scoped_lock(requested_gaze_state_mutex);
+	const std::lock_guard<std::mutex> lock(requested_gaze_state_mutex);
 
 	requested_gaze_state = target;
 }
 
 void Arbiter::set_mouth_target(humotion::MouthState target) {
 	// lock access
-	boost::mutex::scoped_lock scoped_lock(requested_mouth_state_mutex);
+	const std::lock_guard<std::mutex> lock(requested_mouth_state_mutex);
 
 	requested_mouth_state = target;
 }
@@ -122,7 +123,7 @@ void Arbiter::set_mouth_target(humotion::MouthState target) {
 void Arbiter::play_animation(boost::shared_ptr<Animation> incoming_animation) {
 	// incoming animation, check if this would conflict with any pending animations:
 	// lock access & iterate over vector:
-	boost::mutex::scoped_lock lock_av(active_animation_vector_mutex);
+	std::unique_lock<std::mutex> lock_av(active_animation_vector_mutex);
 	active_animation_vector_t::iterator it;
 	for (it = active_animation_vector.begin(); it < active_animation_vector.end(); it++) {
 		boost::shared_ptr<Animation> current_ani = *it;
@@ -167,12 +168,13 @@ void Arbiter::play_animation(boost::shared_ptr<Animation> incoming_animation) {
 void Arbiter::speak(
    boost::shared_ptr<Utterance> u) { //, ao_sample_format audio_format, char *audio_data, unsigned int audio_len){
 	// lock audio playback as such:
-	boost::mutex::scoped_lock scoped_lock_audio(audio_player_mutex);
+	const std::lock_guard<std::mutex> lock_audio(audio_player_mutex);
 
-	// lock utterance & store data:
-	boost::mutex::scoped_lock scoped_lock(utterance_mutex);
-	utterance = u;
-	scoped_lock.unlock();
+	{
+		// lock utterance & store data:
+		const std::lock_guard<std::mutex> lock(utterance_mutex);
+		utterance = u;
+	}
 
 	// start audio playback, this function returns once we started playback
 	if (audio_player == NULL) {
@@ -279,7 +281,7 @@ void Arbiter::override_by_emotion() {
 	}
 
 	// lock access
-	boost::mutex::scoped_lock scoped_lock1(emotion_config_default_mutex);
+	const std::lock_guard<std::mutex> lock1(emotion_config_default_mutex);
 
 	// did the current emotion time out?
 	if (!emotion_target->is_active()) {
@@ -351,7 +353,7 @@ humotion::GazeState Arbiter::soft_overblend_gaze(humotion::GazeState gaze_now, h
 
 void Arbiter::override_by_animation() {
 	// lock access & iterate over vector:
-	boost::mutex::scoped_lock lock_av(active_animation_vector_mutex);
+	const std::lock_guard<std::mutex> lock_av(active_animation_vector_mutex);
 	active_animation_vector_t::iterator it;
 	for (it = active_animation_vector.begin(); it < active_animation_vector.end(); it++) {
 		boost::shared_ptr<Animation> current_ani = *it;
