| 48 | }; |
| 49 | |
| 50 | static void thread_pool_main(REQ_CTX* ctx) |
| 51 | { |
| 52 | |
| 53 | #ifdef ACL_WINDOWS |
| 54 | HWND hWnd = ctx->req->get_hwnd(); |
| 55 | if (hWnd != NULL) { |
| 56 | ctx->req->run(hWnd); |
| 57 | } else |
| 58 | #endif |
| 59 | if (ctx->service) { |
| 60 | ipc_client* ipc = ctx->service->peek_conn(); |
| 61 | if (ipc == NULL) { |
| 62 | logger_error("peek connect to %s error: %s", |
| 63 | ctx->addr, last_serror()); |
| 64 | } else { |
| 65 | ctx->req->run(ipc); |
| 66 | |
| 67 | // �������������Ȼ��������������ӳ��� |
| 68 | if (ipc->active()) { |
| 69 | ctx->service->push_conn(ipc); |
| 70 | } |
| 71 | |
| 72 | // �������ͷŶ�̬���� |
| 73 | else { |
| 74 | delete ipc; |
| 75 | } |
| 76 | } |
| 77 | } else { |
| 78 | // IO ��Ϣģʽ |
| 79 | |
| 80 | ipc_client* ipc = NEW ipc_client(ctx->magic); |
| 81 | |
| 82 | // ������Ϣ������, ����ͬ��IPCͨ����ʽ |
| 83 | if (!ipc->open(ctx->addr, 0)) { |
| 84 | logger_error("open %s error(%s)", |
| 85 | ctx->addr, last_serror()); |
| 86 | } |
| 87 | |
| 88 | // ��������������������� |
| 89 | else { |
| 90 | ctx->req->run(ipc); |
| 91 | } |
| 92 | |
| 93 | // ���� IPC �� |
| 94 | delete ipc; |
| 95 | } |
| 96 | |
| 97 | // �ͷ������߳��з���Ķ��� |
| 98 | acl_myfree(ctx); |
| 99 | } |
| 100 | |
| 101 | static void* thread_once_main(REQ_CTX* ctx) |
| 102 | { |
nothing calls this directly
no test coverage detected
searching dependent graphs…