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:
Thomas Haller 2021-08-24 14:23:14 +02:00
parent 98e476fe4d
commit fb94903444
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
2 changed files with 2 additions and 2 deletions

View file

@ -761,7 +761,7 @@ out:
/*****************************************************************************/
char _nm_utils_to_string_buffer[];
_nm_thread_local char _nm_utils_to_string_buffer[] = {0};
void
nm_utils_to_string_buffer_init(char **buf, gsize *len)

View file

@ -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);
gboolean nm_utils_to_string_buffer_init_null(gconstpointer obj, char **buf, gsize *len);