libcamera: thread: Support timeout in wait() function

Add a parameter to the Thread::wait() function to wait with a timeout.
The delay value utils::duration::max() waits forever.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
Laurent Pinchart
2020-01-23 04:48:56 +02:00
parent 0f292e7821
commit 3f207e0b33
2 changed files with 28 additions and 4 deletions
+3 -1
View File
@@ -14,6 +14,8 @@
#include <libcamera/signal.h>
#include "utils.h"
namespace libcamera {
class EventDispatcher;
@@ -33,7 +35,7 @@ public:
void start();
void exit(int code = 0);
void wait();
bool wait(utils::duration duration = utils::duration::max());
bool isRunning();