From fccdce65b9dd933bf937c60b49ec60013889854f Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 19 Feb 2017 21:45:28 -0500 Subject: [PATCH] Switched to lock guards. --- Outputs/CRT/Internals/Shaders/Shader.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Outputs/CRT/Internals/Shaders/Shader.cpp b/Outputs/CRT/Internals/Shaders/Shader.cpp index 15b8bb43c..4dc5fa90d 100644 --- a/Outputs/CRT/Internals/Shaders/Shader.cpp +++ b/Outputs/CRT/Internals/Shaders/Shader.cpp @@ -292,18 +292,16 @@ void Shader::set_uniform_matrix(const std::string &name, GLint size, GLsizei cou void Shader::enqueue_function(std::function function) { - function_mutex_.lock(); + std::lock_guard function_guard(function_mutex_); enqueued_functions_.push_back(function); - function_mutex_.unlock(); } void Shader::flush_functions() { - function_mutex_.lock(); + std::lock_guard function_guard(function_mutex_); for(std::function function : enqueued_functions_) { function(); } enqueued_functions_.clear(); - function_mutex_.unlock(); }