mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 05:20:08 +01:00
glib-aux: mark _nm_utils_to_string_buffer at thread-local
We possibly should refactor our code to no use _nm_utils_to_string_buffer, but instead always provide a suitable (stack allocated?) buffer. Until that is done, make the buffer thread local so that it avoids the most obvious problem (of resulting in non-thread-safe code).
This commit is contained in:
parent
98e476fe4d
commit
fb94903444
2 changed files with 2 additions and 2 deletions
|
|
@ -761,7 +761,7 @@ out:
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
char _nm_utils_to_string_buffer[];
|
_nm_thread_local char _nm_utils_to_string_buffer[] = {0};
|
||||||
|
|
||||||
void
|
void
|
||||||
nm_utils_to_string_buffer_init(char **buf, gsize *len)
|
nm_utils_to_string_buffer_init(char **buf, gsize *len)
|
||||||
|
|
|
||||||
|
|
@ -1048,7 +1048,7 @@ int _nm_utils_ascii_str_to_bool(const char *str, int default_value);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
extern char _nm_utils_to_string_buffer[2096];
|
_nm_thread_local extern char _nm_utils_to_string_buffer[2096];
|
||||||
|
|
||||||
void nm_utils_to_string_buffer_init(char **buf, gsize *len);
|
void nm_utils_to_string_buffer_init(char **buf, gsize *len);
|
||||||
gboolean nm_utils_to_string_buffer_init_null(gconstpointer obj, char **buf, gsize *len);
|
gboolean nm_utils_to_string_buffer_init_null(gconstpointer obj, char **buf, gsize *len);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue