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