From 6667aa071ecfac7418b49354b25c06a40ff4acfe Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 1 Aug 2017 13:35:58 -0700 Subject: C API: Make uhd_get_last_error() thread-safe The function was directly accessing the error message cache, bypassing locks, and thus could be faulty if being called the same time as another UHD component would update the error string. --- host/include/uhd/error.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'host/include') diff --git a/host/include/uhd/error.h b/host/include/uhd/error.h index 77216dc72..5be04b7b4 100644 --- a/host/include/uhd/error.h +++ b/host/include/uhd/error.h @@ -87,7 +87,8 @@ typedef enum { UHD_API uhd_error error_from_uhd_exception(const uhd::exception* e); -UHD_API const std::string& get_c_global_error_string(); +//! Return a copy of the last error string. +UHD_API std::string get_c_global_error_string(); UHD_API void set_c_global_error_string(const std::string &msg); -- cgit v1.2.3