Lely core libraries
2.3.4
|
This file is part of the event library; it contains the implementation of the thread-local event loop functions. More...
#include "ev.h"
#include <lely/ev/exec.h>
#include <lely/ev/task.h>
#include <lely/ev/thrd_loop.h>
#include <assert.h>
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | ev_thrd_loop |
A thread-local event loop. More... | |
Functions | |
static struct ev_thrd_loop * | ev_thrd_loop (void) |
Returns a pointer to the thread-local event loop. | |
ev_exec_t * | ev_thrd_loop_get_exec (void) |
Returns a pointer to the executor corresponding to the thread-local event loop. More... | |
void | ev_thrd_loop_stop (void) |
Stops the thread-local event loop. More... | |
int | ev_thrd_loop_stopped (void) |
Returns 1 if the thread-local event loop is stopped, and 0 if not. | |
void | ev_thrd_loop_restart (void) |
Restarts a thread-local event loop. More... | |
size_t | ev_thrd_loop_run (void) |
If the thread-local event loop is not stopped, run all available tasks. More... | |
size_t | ev_thrd_loop_run_one (void) |
If the thread-local event loop is not stopped, executes the first task submitted to it, if available. More... | |
This file is part of the event library; it contains the implementation of the thread-local event loop functions.
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 thrd_loop.c.
ev_exec_t* ev_thrd_loop_get_exec | ( | void | ) |
Returns a pointer to the executor corresponding to the thread-local event loop.
This pointer is shared between all threads.
Definition at line 75 of file thrd_loop.c.
void ev_thrd_loop_stop | ( | void | ) |
Stops the thread-local event loop.
Subsequent calls to ev_thrd_loop_run() and ev_thrd_loop_run_one() will return 0 immediately.
Definition at line 83 of file thrd_loop.c.
void ev_thrd_loop_restart | ( | void | ) |
Restarts a thread-local event loop.
Definition at line 95 of file thrd_loop.c.
size_t ev_thrd_loop_run | ( | void | ) |
If the thread-local event loop is not stopped, run all available tasks.
If, afterwards, no outstanding work remains, performs ev_thrd_loop_stop().
Definition at line 101 of file thrd_loop.c.
size_t ev_thrd_loop_run_one | ( | void | ) |
If the thread-local event loop is not stopped, executes the first task submitted to it, if available.
If, afterwards, no outstanding work remains, performs ev_thrd_loop_stop().
Definition at line 110 of file thrd_loop.c.