diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-03-29 21:16:28 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-11-30 22:17:58 +0100 |
commit | 419dfe6a7049c0ee7f469cc10724ea110bef3c9c (patch) | |
tree | 93c09b8621dcea6a3643738a2a2d01688b584107 /tests/bgpd/test_capability.c | |
parent | bgpd: remove unused `struct thread` from peer (diff) | |
download | frr-419dfe6a7049c0ee7f469cc10724ea110bef3c9c.tar.xz frr-419dfe6a7049c0ee7f469cc10724ea110bef3c9c.zip |
bgpd: dynamically allocate synchronization primitives
Changes all synchronization primitives to be dynamically allocated. This
should help catch any subtle errors in pthread lifecycles.
This change also pre-initializes synchronization primitives before
threads begin to run, eliminating a potential race condition that
probably would have caused a segfault on startup on a very fast box.
Also changes mutex and condition variable allocations to use
MTYPE_PTHREAD and updates tests to do the proper initializations.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'tests/bgpd/test_capability.c')
-rw-r--r-- | tests/bgpd/test_capability.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/bgpd/test_capability.c b/tests/bgpd/test_capability.c index e8700a8b4..05c409647 100644 --- a/tests/bgpd/test_capability.c +++ b/tests/bgpd/test_capability.c @@ -903,6 +903,7 @@ int main(void) bgp_master_init(master); vrf_init(NULL, NULL, NULL, NULL); bgp_option_set(BGP_OPT_NO_LISTEN); + peer_writes_init(); if (fileno(stdout) >= 0) tty = isatty(fileno(stdout)); |