HomeClusterLabs Projects

[libknet] allow better handling of internal threads

Description

[libknet] allow better handling of internal threads

while playing around adding some dynamic internal threads, i did
hit a limitation with allocating a dynamic THREAD_MAX value based
on OS availability of certain features.

this patch changes from dynamic to static allocation of threads, that
can always be increased if necessary without breaking anything.

simplify thread numbering and conditionals on OS features

improve debugging of thread status by adding a 2 phase thread registration
process:

  • register a thread before starting it with THREAD_REGISTERED before pthread_create
  • set a thread status as started with THREAD_STARTED

any failure in between can now be detected in debugging logs.

Note for developers: all threads *MUST* be registered/started before
wait_all_threads_status check in handle.c.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>

Details

Provenance
fabbioneAuthored on Jan 7 2019, 3:54 AM
Parents
rK85602da62e27: [build] enable all compilers warnings at once
Branches
Unknown
Tags
Unknown

Event Timeline