summaryrefslogtreecommitdiffstats
path: root/tests/bgpd/test_capability.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2017-03-29 21:16:28 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2017-11-30 22:17:58 +0100
commit419dfe6a7049c0ee7f469cc10724ea110bef3c9c (patch)
tree93c09b8621dcea6a3643738a2a2d01688b584107 /tests/bgpd/test_capability.c
parentbgpd: remove unused `struct thread` from peer (diff)
downloadfrr-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.c1
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));