Lely core libraries  2.3.4
poll.h File Reference

This header file is part of the event library; it contains the abstract polling interface. More...

#include <lely/ev/ev.h>
Include dependency graph for poll.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ev_poll_vtbl
 

Typedefs

typedef const struct ev_poll_vtbl *const ev_poll_t
 The abstract polling interface.
 

Functions

void * ev_poll_self (const ev_poll_t *poll)
 Returns the identifier of the calling thread. More...
 
int ev_poll_wait (ev_poll_t *poll, int timeout)
 Waits for at most timeout milliseconds while polling for new events. More...
 
int ev_poll_kill (ev_poll_t *poll, void *thr)
 Interrupts a polling wait on the specified thread. More...
 

Detailed Description

This header file is part of the event library; it contains the abstract polling interface.

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 poll.h.

Function Documentation

◆ ev_poll_self()

void * ev_poll_self ( const ev_poll_t poll)
inline

Returns the identifier of the calling thread.

This identifier can be used to interrupt a call to ev_poll_wait() from another thread with ev_poll_kill().

Definition at line 69 of file poll.h.

◆ ev_poll_wait()

int ev_poll_wait ( ev_poll_t poll,
int  timeout 
)
inline

Waits for at most timeout milliseconds while polling for new events.

If timeout is 0, this function will not wait. If timeout is negative, this function will wait indefinitely.

Returns
0 on success, or -1 on error. In the latter case, the error code can be obtained with get_errc().

Definition at line 75 of file poll.h.

◆ ev_poll_kill()

int ev_poll_kill ( ev_poll_t poll,
void *  thr 
)
inline

Interrupts a polling wait on the specified thread.

Returns
0 on success, or -1 on error. In the latter case, the error code can be obtained with get_errc().

Definition at line 81 of file poll.h.