diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-08-01 13:35:58 -0700 |
---|---|---|
committer | Moritz Fischer <moritz.fischer@ettus.com> | 2017-08-07 16:09:50 -0700 |
commit | 6667aa071ecfac7418b49354b25c06a40ff4acfe (patch) | |
tree | 8af5b53891b3d815dfcfd139b389dabc002ef3ba /host/include | |
parent | b5e43a27ab444f9276e15086871a1c249ba3df2b (diff) | |
download | uhd-6667aa071ecfac7418b49354b25c06a40ff4acfe.tar.gz uhd-6667aa071ecfac7418b49354b25c06a40ff4acfe.tar.bz2 uhd-6667aa071ecfac7418b49354b25c06a40ff4acfe.zip |
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.
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/error.h | 3 |
1 files changed, 2 insertions, 1 deletions
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); |