failure to post a function is not fatal unless we wrote part of a command (should be impossible)
Former-commit-id: e1c642a033ab0157a66571189e81817cb84fd421
This commit is contained in:
parent
e54be2c065
commit
5da19e0206
@ -130,6 +130,7 @@ struct aeCommand
|
||||
void *clientData;
|
||||
aeCommandControl *pctl;
|
||||
};
|
||||
static_assert(sizeof(aeCommand) <= PIPE_BUF);
|
||||
|
||||
void aeProcessCmd(aeEventLoop *eventLoop, int fd, void *, int )
|
||||
{
|
||||
@ -296,7 +297,10 @@ int aePostFunction(aeEventLoop *eventLoop, std::function<void()> fn, bool fSynch
|
||||
}
|
||||
|
||||
auto size = write(eventLoop->fdCmdWrite, &cmd, sizeof(cmd));
|
||||
AE_ASSERT(size == sizeof(cmd));
|
||||
AE_ASSERT(!size || size == sizeof(cmd));
|
||||
if (size == 0)
|
||||
return AE_ERR;
|
||||
|
||||
int ret = AE_OK;
|
||||
if (fSynchronous)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user