MCPcopy Create free account
hub / github.com/acl-dev/acl / thread_once_main

Function thread_once_main

lib_acl_cpp/src/ipc/ipc_service.cpp:101–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101static 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

Callers

nothing calls this directly

Calls 8

acl_last_serrorFunction · 0.85
activeMethod · 0.80
push_connMethod · 0.80
last_serrorFunction · 0.50
ipc_clientClass · 0.50
runMethod · 0.45
peek_connMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…