| 227 | } |
| 228 | |
| 229 | int aeCreateRemoteFileEvent(aeEventLoop *eventLoop, int fd, int mask, |
| 230 | aeFileProc *proc, void *clientData) |
| 231 | { |
| 232 | if (eventLoop == g_eventLoopThisThread) |
| 233 | return aeCreateFileEvent(eventLoop, fd, mask, proc, clientData); |
| 234 | |
| 235 | int ret = AE_OK; |
| 236 | |
| 237 | aeCommand cmd; |
| 238 | cmd.op = AE_ASYNC_OP::CreateFileEvent; |
| 239 | cmd.fd = fd; |
| 240 | cmd.mask = mask; |
| 241 | cmd.fproc = proc; |
| 242 | cmd.clientData = clientData; |
| 243 | cmd.fLock = true; |
| 244 | |
| 245 | auto size = safe_write(eventLoop->fdCmdWrite, &cmd, sizeof(cmd)); |
| 246 | if (size != sizeof(cmd)) |
| 247 | { |
| 248 | serverAssert(size == sizeof(cmd) || size <= 0); |
| 249 | serverAssert(errno == EAGAIN); |
| 250 | ret = AE_ERR; |
| 251 | } |
| 252 | |
| 253 | return ret; |
| 254 | } |
| 255 | |
| 256 | int aePostFunction(aeEventLoop *eventLoop, aePostFunctionProc *proc, void *arg) |
| 257 | { |
nothing calls this directly
no test coverage detected