]> granicus.if.org Git - procps-ng/commit
library: refine support for multiple concurrent access
authorJim Warner <james.warner@comcast.net>
Wed, 10 Nov 2021 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Sun, 14 Nov 2021 05:23:07 +0000 (16:23 +1100)
commiteafd8e31124697be859a3d305e72b03b9be8bc95
treeff80caab23711e8a6f94773403f39f01413e04ce
parent126b14470ef93857e398b0b3e2d4624dc9f52db5
library: refine support for multiple concurrent access

Our new library's now well protected against potential
problems which arise when a multi-threaded application
opens more than one context within the same API at the
same time. However, with a single-threaded application
designed along those same lines, some problems remain.

So, to avoid potential corruption of some data (which
was classified as local 'static __thread') from those
single-threaded designs, we'll move several variables
to the info structure itself and remove the '__thread'
qualifier. Now they're protected against both designs.

[ we'll not be protected against some multi-threaded ]
[ application that shares a single context yet calls ]
[ that interface from separate threads. this is just ]
[ bad application design & no different than sharing ]
[ other modifiable global data between such threads! ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
proc/meminfo.c
proc/pids.c
proc/slabinfo.c
proc/stat.c
proc/vmstat.c