[procps] some final thread stuff

  • From: Jim Warner <james.warner@xxxxxxxxxxx>
  • To: Procps-ng Mail list <procps@xxxxxxxxxxxxx>
  • Date: Thu, 14 Oct 2021 13:49:23 -0500

Hi Craig,

Here are what I think will be my final pthread related patches.

The first one hopefully eliminates any build problems associated with top's use of the pthread library. Now 'pthread_sigmask' will only be called when one or more top threads have been enabled (they're all off by default). Whoever turns them on is now responsible for proper linking.

The last two patches are geared toward future multi-threaded application development. Because newlib encapsulates heap allocations in some '__thread' classed structures, valgrind may issue some warnings. These patches deal with suppressing them.

I'm pretty confident our newlib is now thread safe after activating top thread support along with some temporary hacks. As long as each thread maintains its own 'new()' context, I could find no problem with concurrent access.

Thanks in advance for the push.

Regards,

Jim

p.s. In the future, I resolve to pay more attention to those GitLab pipeline issues.

Other related posts: