Lely core libraries  2.2.5
timer.c File Reference

This file is part of the I/O library; it exposes the abstract timer functions. More...

#include "io2.h"
#include <lely/io2/timer.h>
#include <lely/util/util.h>
#include <assert.h>
Include dependency graph for timer.c:

Go to the source code of this file.

Data Structures

struct  io_timer_async_wait
 

Functions

ev_future_tio_timer_async_wait (io_timer_t *timer, ev_exec_t *exec, struct io_timer_wait **pwait)
 Submits an asynchronous wait operation to an I/O timer and creates a future which becomes ready once the wait operation completes (or is canceled). More...
 
struct io_timer_waitio_timer_wait_from_task (struct ev_task *task)
 Obtains a pointer to an I/O timer wait operation from a pointer to its completion task.
 

Detailed Description

This file is part of the I/O library; it exposes the abstract timer functions.

See also
lely/io2/timer.h
Author
J. S. Seldenthuis jseld.nosp@m.enth.nosp@m.uis@l.nosp@m.ely..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file timer.c.

Function Documentation

◆ io_timer_async_wait()

ev_future_t* io_timer_async_wait ( io_timer_t timer,
ev_exec_t exec,
struct io_timer_wait **  pwait 
)

Submits an asynchronous wait operation to an I/O timer and creates a future which becomes ready once the wait operation completes (or is canceled).

The result of the future has type io_timer_wait_result.

Parameters
timera pointer to an I/O timer.
execa pointer to the executor used to execute the completion function of the wait operation. If NULL, the default executor of the I/O timer is used.
pwaitthe address at which to store a pointer to the wait operation (can be NULL).
Returns
a pointer to a future, or NULL on error. In the latter case, the error number can be obtained with get_errc().

Definition at line 39 of file timer.c.