Skip to content
Snippets Groups Projects
Commit 800cec73 authored by imarkov's avatar imarkov Committed by Konstantin Osipov
Browse files

coio: Modify coio_task_post behavior

Remove yielding and waiting task complete in coio_task_post
in case if timeout is zero.
This patch is inspired by the need in log_rotate posting coio
task. This post should not yield there because the implementation
of multiple loggers works with linked list structure of loggers
which is not fiber-safe.
parent f42c0e93
No related branches found
No related tags found
No related merge requests found
......@@ -234,6 +234,15 @@ coio_task_post(struct coio_task *task, double timeout)
assert(task->fiber == fiber());
eio_submit(&task->base);
if (timeout == 0) {
/*
* This is a special case:
* we don't wait any response from the task
* and just perform just asynchronous post.
*/
task->fiber = NULL;
return 0;
}
fiber_yield_timeout(timeout);
if (!task->complete) {
/* timed out or cancelled. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment