In the commit referenced below, a '__thread' attribute
was added to numerous static variables to protect them
from concurrent access conflicts with multi-threading.
Unfortunately, that patch did not go quite far enough.
So, this commit adds a few more '__thread' qualifiers.
Reference(s):
commit
23cfb7136636f2d522b31417892de79b011ad3e4
Signed-off-by: Jim Warner <james.warner@comcast.net>
char name[16];
} tty_map_node;
-static tty_map_node *tty_map = NULL;
+static __thread tty_map_node *tty_map = NULL;
/* Load /proc/tty/drivers for device name mapping use. */
static void load_drivers(void){
static char ERRname[] = "?";
-static struct pwbuf {
+static __thread struct pwbuf {
struct pwbuf *next;
uid_t uid;
char name[P_G_SZ];
return((*p)->name);
}
-static struct grpbuf {
+static __thread struct grpbuf {
struct grpbuf *next;
gid_t gid;
char name[P_G_SZ];
// utility buffers of MAX_BUFSZ bytes each, available to
// any function following an openproc() call
-static char *src_buffer,
- *dst_buffer;
+static __thread char *src_buffer,
+ *dst_buffer;
#define MAX_BUFSZ 1024*64*2
// dynamic 'utility' buffer support for file2str() calls