From 918797735da29f102f027b9dc19dccc751950c76 Mon Sep 17 00:00:00 2001 From: Cedric Nugteren Date: Mon, 14 Mar 2016 22:55:22 +0100 Subject: Made the library thread-safe by guarding the kernel cache with a mutex --- include/internal/routine.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/internal/routine.h b/include/internal/routine.h index b7c06a97..5f5b8211 100644 --- a/include/internal/routine.h +++ b/include/internal/routine.h @@ -18,6 +18,7 @@ #include #include +#include #include "internal/utilities.h" #include "internal/database.h" @@ -46,8 +47,9 @@ class Routine { } }; - // The actual cache, implemented as a vector of the above data-type + // The actual cache, implemented as a vector of the above data-type, and its mutex static std::vector program_cache_; + static std::mutex program_cache_mutex_; // Helper functions which check for errors in the status code static constexpr bool ErrorIn(const StatusCode s) { return (s != StatusCode::kSuccess); } -- cgit v1.2.3