summaryrefslogtreecommitdiffstats
path: root/src/gsm/abis_nm.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-03-28 10:49:05 +0100
committerHarald Welte <laforge@gnumonks.org>2019-06-04 10:47:30 +0200
commit171ef826e1489031bc48745f29fa2d4657bf165f (patch)
tree08c8c32fae7f33f59df7621d6e3e8b8e127d856b /src/gsm/abis_nm.c
parent9b207419105c5e07504b1b7bf380eda07c127bb2 (diff)
make all library-internal static buffers thread-local
We have a number of library-internal static global buffers which are mainly used for various stringification functions. This worked as all of the related Osmocom programs were strictly single-threaded. Let's make those buffers at least thread-local. This way every thread gets their own set of buffers, and it's safe for multiple threads to execute the same functions once. They're of course still not re-entrant. If you need re-entrancy, you will need to use the _c() or _buf() suffix version of those functions and work with your own (stack or heap) buffers. Change-Id: I50eb2436a7c1261d79a9d2955584dce92780ca07
Diffstat (limited to 'src/gsm/abis_nm.c')
-rw-r--r--src/gsm/abis_nm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gsm/abis_nm.c b/src/gsm/abis_nm.c
index a4c0e41f..3fb8f0f5 100644
--- a/src/gsm/abis_nm.c
+++ b/src/gsm/abis_nm.c
@@ -939,7 +939,7 @@ char *abis_nm_dump_foh_buf(char *buf, size_t buf_len, const struct abis_om_fom_h
const char *abis_nm_dump_foh(const struct abis_om_fom_hdr *foh)
{
- static char foh_buf[128];
+ static __thread char foh_buf[128];
return abis_nm_dump_foh_buf(foh_buf, sizeof(foh_buf), foh);
}