Wait for all threads to finish executing before leaving in an EventBase test
authorChristopher Dykes <cdykes@fb.com>
Wed, 10 Aug 2016 00:33:05 +0000 (17:33 -0700)
committerFacebook Github Bot 0 <facebook-github-bot-0-bot@fb.com>
Wed, 10 Aug 2016 00:38:28 +0000 (17:38 -0700)
commit10e9cd3edc9e1e4cb78ddffcf8966d1bf241deee
treedb5013ddb327686ff9d3e535380331443fc74e0e
parent52286a8b458d66b2471211d83576e0c240946e57
Wait for all threads to finish executing before leaving in an EventBase test

Summary:
If one of the assertions failed, it would result in any threads that are still running accessing already-disposed data, so wait for the threads to exit, even when an exception is thrown.

This also slightly cleans up the handling of threads a bit further down, because the mess it was doing was completely unnecessary.

Reviewed By: yfeldblum

Differential Revision: D3692438

fbshipit-source-id: 9082ba248b2cf1062e46c97faf0bc062312ee9ae
folly/io/async/test/EventBaseTest.cpp