| 99 | } |
| 100 | |
| 101 | static void* thread_once_main(REQ_CTX* ctx) |
| 102 | { |
| 103 | #ifdef ACL_WINDOWS |
| 104 | HWND hWnd = ctx->req->get_hwnd(); |
| 105 | if (hWnd != NULL) { |
| 106 | ctx->req->run(hWnd); |
| 107 | } else |
| 108 | #endif |
| 109 | if (ctx->service) { |
| 110 | ipc_client* ipc = ctx->service->peek_conn(); |
| 111 | if (ipc == NULL) { |
| 112 | logger_error("peek connect to %s error: %s", |
| 113 | ctx->addr, last_serror()); |
| 114 | } else { |
| 115 | ctx->req->run(ipc); |
| 116 | |
| 117 | // �������������Ȼ��������������ӳ��� |
| 118 | if (ipc->active()) { |
| 119 | ctx->service->push_conn(ipc); |
| 120 | } |
| 121 | |
| 122 | // �������ͷŶ�̬���� |
| 123 | else { |
| 124 | delete ipc; |
| 125 | } |
| 126 | } |
| 127 | } else { |
| 128 | // IO ��Ϣģʽ |
| 129 | |
| 130 | ipc_client* ipc = NEW ipc_client(ctx->magic); |
| 131 | |
| 132 | // ������Ϣ������ |
| 133 | if (!ipc->open(ctx->addr, 0)) { |
| 134 | logger_error("open %s error(%s)", |
| 135 | ctx->addr, acl_last_serror()); |
| 136 | } |
| 137 | |
| 138 | // ��������������������� |
| 139 | else { |
| 140 | ctx->req->run(ipc); |
| 141 | } |
| 142 | // ���� IPC �� |
| 143 | delete ipc; |
| 144 | } |
| 145 | |
| 146 | // �ͷ������߳��з���Ķ��� |
| 147 | acl_myfree(ctx); |
| 148 | return NULL; |
| 149 | } |
| 150 | |
| 151 | /////////////////////////////////////////////////////////////////////////// |
| 152 |
nothing calls this directly
no test coverage detected
searching dependent graphs…