| 428 | } |
| 429 | |
| 430 | bool CAHttpClient::lazyInitThreadSemphore() |
| 431 | { |
| 432 | if (!s_requestQueue.empty()) |
| 433 | { |
| 434 | return true; |
| 435 | } |
| 436 | else |
| 437 | { |
| 438 | pthread_mutex_init(&s_requestQueueMutex, NULL); |
| 439 | pthread_mutex_init(&s_responseQueueMutex, NULL); |
| 440 | |
| 441 | pthread_mutex_init(&s_SleepMutex, NULL); |
| 442 | pthread_cond_init(&s_SleepCondition, NULL); |
| 443 | |
| 444 | pthread_create(&s_networkThread, NULL, networkThread, this); |
| 445 | pthread_detach(s_networkThread); |
| 446 | |
| 447 | need_quit = false; |
| 448 | } |
| 449 | |
| 450 | return true; |
| 451 | } |
| 452 | |
| 453 | void CAHttpClient::send(CAHttpRequest* request) |
| 454 | { |
nothing calls this directly
no test coverage detected