Line data Source code
1 : #include "source/common/event/libevent.h" 2 : 3 : #include <csignal> 4 : 5 : #include "source/common/common/assert.h" 6 : 7 : #include "event2/thread.h" 8 : 9 : namespace Envoy { 10 : namespace Event { 11 : namespace Libevent { 12 : 13 : bool Global::initialized_ = false; 14 : 15 69 : void Global::initialize() { 16 : #ifdef WIN32 17 : evthread_use_windows_threads(); 18 : #else 19 69 : evthread_use_pthreads(); 20 : 21 : // Ignore SIGPIPE and allow errors to propagate through error codes. 22 69 : signal(SIGPIPE, SIG_IGN); 23 69 : #endif 24 69 : initialized_ = true; 25 69 : } 26 : 27 : } // namespace Libevent 28 : } // namespace Event 29 : } // namespace Envoy