Lely core libraries 2.3.4
thrd_loop.hpp
Go to the documentation of this file.
1
24#ifndef LELY_EV_THRD_LOOP_HPP_
25#define LELY_EV_THRD_LOOP_HPP_
26
27#include <lely/ev/exec.hpp>
28#include <lely/ev/thrd_loop.h>
29
30namespace lely {
31namespace ev {
32
34class ThreadLoop : public Executor {
35 public:
37 static Executor
41
43 static void
47
49 static bool
51 return ev_thrd_loop_stopped() != 0;
52 }
53
55 static void
59
61 static ::std::size_t
63 return ev_thrd_loop_run();
64 }
65
67 static ::std::size_t
69 return ev_thrd_loop_run_one();
70 }
71};
72
73} // namespace ev
74} // namespace lely
75
76#endif // !LELY_EV_THRD_LOOP_HPP_
A CANopen value.
Definition val.hpp:42
An abstract task executor. This class is a wrapper around #ev_exec_t*.
Definition exec.hpp:38
The thread-local event loop.
Definition thrd_loop.hpp:34
::std::size_t run() noexcept
Definition thrd_loop.hpp:62
static bool stopped() noexcept
Definition thrd_loop.hpp:50
static void stop() noexcept
Definition thrd_loop.hpp:44
static Executor get_executor() noexcept
Definition thrd_loop.hpp:38
::std::size_t run_one() noexcept
Definition thrd_loop.hpp:68
static void restart() noexcept
Definition thrd_loop.hpp:56
This header file is part of the event library; it contains the C++ interface for the abstract task ex...
This header file is part of the event library; it contains the thread-local event loop declarations.
size_t ev_thrd_loop_run(void)
If the thread-local event loop is not stopped, run all available tasks.
Definition thrd_loop.c:101
ev_exec_t * ev_thrd_loop_get_exec(void)
Returns a pointer to the executor corresponding to the thread-local event loop.
Definition thrd_loop.c:75
void ev_thrd_loop_stop(void)
Stops the thread-local event loop.
Definition thrd_loop.c:83
size_t ev_thrd_loop_run_one(void)
If the thread-local event loop is not stopped, executes the first task submitted to it,...
Definition thrd_loop.c:110
void ev_thrd_loop_restart(void)
Restarts a thread-local event loop.
Definition thrd_loop.c:95
int ev_thrd_loop_stopped(void)
Returns 1 if the thread-local event loop is stopped, and 0 if not.
Definition thrd_loop.c:89