void slp_channel_insert(PyChannelObject *channel, PyTaskletObject *task, int dir) { SLP_HEADCHAIN_INSERT(PyTaskletObject, channel, task, next, prev); channel->balance += dir; task->flags.blocked = dir; }
void slp_channel_insert(PyChannelObject *channel, PyTaskletObject *task, int dir, PyTaskletObject *nexttask) { if (nexttask) assert(slp_channel_has_tasklet(channel, nexttask)); else nexttask = (PyTaskletObject*)channel; SLP_HEADCHAIN_INSERT(PyTaskletObject, nexttask, task, next, prev); assert(dir == -1 || dir == 1); assert(dir * channel->balance >= 0); /* we are going the right way */ channel->balance += dir; task->flags.blocked = dir; }