MCPcopy Create free account
hub / github.com/Tencent/phxsql / main

Function main

phxsqlproxy/test/testsqlproxy.cpp:157–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157int main(int argc, char ** argv) {
158 //RoutineSetSpecificCallback(co_getspecific, co_setspecific);
159 if (argc < 4) {
160 showUsage(argc, argv);
161 exit(-1);
162 }
163
164 signal(SIGPIPE, SIG_IGN);
165 phxsqlproxy::PHXSqlProxyConfig config;
166 if (config.ReadConfig(argv[1]) != 0) {
167 printf("ReadConfig [%s] failed\n", argv[1]);
168 showUsage(argc, argv);
169 exit(-1);
170 }
171
172 int thread_num = atoi(argv[2]);
173 int routine_num = atoi(argv[3]);
174
175 for (int i = 0; i < thread_num; ++i) {
176 TestPHXSqlProxyThread * thread = new TestPHXSqlProxyThread(&config, i, routine_num);
177 thread->start();
178 }
179 co_eventloop(co_get_epoll_ct(), 0, 0);
180 return 0;
181}
182
183

Callers

nothing calls this directly

Calls 3

showUsageFunction · 0.70
ReadConfigMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected