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
1665
void Global::initialize() {
16
#ifdef WIN32
17
  evthread_use_windows_threads();
18
#else
19
1665
  evthread_use_pthreads();
20

            
21
  // Ignore SIGPIPE and allow errors to propagate through error codes.
22
1665
  signal(SIGPIPE, SIG_IGN);
23
1665
#endif
24
1665
  initialized_ = true;
25
1665
}
26

            
27
} // namespace Libevent
28
} // namespace Event
29
} // namespace Envoy