logDebug when then nio stage equals to the target
parent
b9b5dd490d
commit
42c8a65a8f
17
src/sf_nio.c
17
src/sf_nio.c
|
|
@ -324,11 +324,18 @@ int sf_nio_notify(struct fast_task_info *task, const int stage)
|
|||
if (!__sync_bool_compare_and_swap(&task->nio_stages.notify,
|
||||
SF_NIO_STAGE_NONE, stage))
|
||||
{
|
||||
logWarning("file: "__FILE__", line: %d, "
|
||||
"current stage: %d != %d, skip set stage to %d",
|
||||
__LINE__, __sync_fetch_and_sub(&task->nio_stages.notify, 0),
|
||||
SF_NIO_STAGE_NONE, stage);
|
||||
return EAGAIN;
|
||||
if (__sync_fetch_and_add(&task->nio_stages.notify, 0) == stage) {
|
||||
logDebug("file: "__FILE__", line: %d, "
|
||||
"current stage: %d equals to the target, skip set",
|
||||
__LINE__, stage);
|
||||
return 0;
|
||||
} else {
|
||||
logWarning("file: "__FILE__", line: %d, "
|
||||
"current stage: %d != %d, skip set stage to %d",
|
||||
__LINE__, __sync_fetch_and_add(&task->nio_stages.notify, 0),
|
||||
SF_NIO_STAGE_NONE, stage);
|
||||
return EAGAIN;
|
||||
}
|
||||
}
|
||||
|
||||
PTHREAD_MUTEX_LOCK(&task->thread_data->waiting_queue.lock);
|
||||
|
|
|
|||
Loading…
Reference in New Issue