mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
wpiutil: EventLoopRunner: Allow getting the loop shared_ptr.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#define WPIUTIL_WPI_EVENTLOOPRUNNER_H_
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
#include "wpi/SafeThread.h"
|
||||
#include "wpi/uv/Loop.h"
|
||||
@@ -42,6 +43,12 @@ class EventLoopRunner {
|
||||
*/
|
||||
void ExecSync(LoopFunc func);
|
||||
|
||||
/**
|
||||
* Get the loop. If the loop thread is not running, returns nullptr.
|
||||
* @return The loop
|
||||
*/
|
||||
std::shared_ptr<uv::Loop> GetLoop();
|
||||
|
||||
private:
|
||||
class Thread;
|
||||
SafeThreadOwner<Thread> m_owner;
|
||||
|
||||
Reference in New Issue
Block a user