#50 增加evthread_use_pthreads初始化,保证event_base的线程安全。

This commit is contained in:
zhengchao
2018-10-28 21:43:30 +08:00
parent 618f81bac5
commit b6868bb079

View File

@@ -305,6 +305,9 @@ int main(int argc, char *argv[])
/* LOGGER */
g_default_proxy->logger = g_default_logger;
/* adds locking, only required if accessed from separate threads */
evthread_use_pthreads();
/* MAIN THREAD EVBASE */
g_default_proxy->evbase = event_base_new();
CHECK_OR_EXIT(g_default_proxy->evbase, "Failed at creating evbase for main thread. Exit.");