11 #include <sys/types.h> 14 #include <libcamera/base/private.h> 19 #include <libcamera/base/span.h> 24 class EventDispatcher;
37 void exit(
int code = 0);
52 Object *receiver =
nullptr);
64 void setThreadAffinityInternal();
66 void postMessage(std::unique_ptr<Message> msg,
Object *receiver);
67 void removeMessages(
Object *receiver);
73 void moveObject(
Object *
object);
bool wait(utils::duration duration=utils::duration::max())
Wait for the thread to finish.
Definition: thread.cpp:394
Utilities to help constructing class interfaces.
static Thread * current()
Retrieve the Thread instance for the current thread.
Definition: thread.cpp:487
EventDispatcher * eventDispatcher()
Retrieve the event dispatcher.
Definition: thread.cpp:519
Top-level libcamera namespace.
Definition: backtrace.h:17
Interface to manage the libcamera events and timers.
Definition: event_dispatcher.h:17
Thread-local internal data.
Definition: thread.cpp:105
A thread of execution.
Definition: thread.h:30
static pid_t currentId()
Retrieve the ID of the current thread.
Definition: thread.cpp:503
int setThreadAffinity(const Span< const unsigned int > &cpus)
Set the CPU affinity mask of the thread.
Definition: thread.cpp:428
Miscellaneous utility functions.
virtual void run()
Main function of the thread.
Definition: thread.cpp:336
Signal & slot implementation.
bool isRunning()
Check if the thread is running.
Definition: thread.cpp:471
void dispatchMessages(Message::Type type=Message::Type::None, Object *receiver=nullptr)
Dispatch posted messages for this thread.
Definition: thread.cpp:622
#define LIBCAMERA_DISABLE_COPY_AND_MOVE(klass)
Disable copy and move construction and assignment of the klass.
std::chrono::steady_clock::duration duration
The libcamera duration related to libcamera::utils::clock.
Definition: utils.h:73
int exec()
Enter the event loop.
Definition: thread.cpp:302
void exit(int code=0)
Stop the thread's event loop.
Definition: thread.cpp:369
Thread()
Create a thread.
Definition: thread.cpp:233
Generic signal and slot communication mechanism.
Definition: object.h:21
Signal finished
Signal the end of thread execution.
Definition: thread.h:44
void start()
Start the thread.
Definition: thread.cpp:248
Type
The message type.
Definition: message.h:26
Base object to support automatic signal disconnection.
Definition: object.h:25
Thread wrapper for the main thread.
Definition: thread.cpp:139