14#include <libcamera/base/private.h>
18#include <libcamera/base/span.h>
36 void exit(
int code = 0);
60 void setThreadAffinityInternal();
62 void postMessage(std::unique_ptr<Message> msg, Object *receiver);
63 void removeMessages(Object *receiver);
66 friend class ThreadData;
67 friend class ThreadMain;
69 void moveObject(Object *
object);
70 void moveObject(Object *
object, ThreadData *currentData,
71 ThreadData *targetData);
Interface to manage the libcamera events and timers.
Definition event_dispatcher.h:18
A message that can be posted to a Thread.
Definition message.h:24
Type
The message type.
Definition message.h:26
@ None
Invalid message type.
Definition message.h:27
Base object to support automatic signal disconnection.
Definition object.h:25
Generic signal and slot communication mechanism.
Definition signal.h:39
Thread-local internal data.
Definition thread.cpp:106
Thread wrapper for the main thread.
Definition thread.cpp:140
static Thread * current()
Retrieve the Thread instance for the current thread.
Definition thread.cpp:487
static pid_t currentId()
Retrieve the ID of the current thread.
Definition thread.cpp:503
EventDispatcher * eventDispatcher()
Retrieve the event dispatcher.
Definition thread.cpp:519
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
void start()
Start the thread.
Definition thread.cpp:248
virtual void run()
Main function of the thread.
Definition thread.cpp:336
void dispatchMessages(Message::Type type=Message::Type::None)
Dispatch posted messages for this thread.
Definition thread.cpp:620
bool wait(utils::duration duration=utils::duration::max())
Wait for the thread to finish.
Definition thread.cpp:394
bool isRunning()
Check if the thread is running.
Definition thread.cpp:471
int setThreadAffinity(const Span< const unsigned int > &cpus)
Set the CPU affinity mask of the thread.
Definition thread.cpp:428
Thread()
Create a thread.
Definition thread.cpp:233
Signal finished
Signal the end of thread execution.
Definition thread.h:43
Top-level libcamera namespace.
Definition backtrace.h:17
Signal & slot implementation.
Miscellaneous utility functions.
std::chrono::steady_clock::duration duration
The libcamera duration related to libcamera::utils::clock.
Definition utils.h:72