]> git.puffer.fish Git - matthieu/frr.git/commit
lib: make `show thread...` commands mt-aware
authorQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 15 Jun 2017 19:10:57 +0000 (19:10 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 29 Jun 2017 23:37:08 +0000 (23:37 +0000)
commit62f44022399236ec619a6ebedd3bd6e11765fafd
tree8a03ce01b48119922e62bb313aa52fe92b30ea3f
parente0bebc7c223abf239b5ccda1c2de42a2b0410455
lib: make `show thread...` commands mt-aware

This patch fixes up show thread commands so that they know about
and operate on all extant thread_masters, since we can now have multiple
running in any given application.

This change also eliminates a heap use after free that appears when
using a single cpu_record shared among multiple threads. Since struct
thread's have pointers to bits of memory that are freed when the global
statistics hash table is freed, later accesses are invalid. By moving
the stats hash to be unique to each thread_master this problem is
sidestepped.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
lib/thread.c
lib/thread.h