WPILibC++  2018.4.1-20180820040250-1165-g0b8f4b5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
wpi::EventLoopRunner Class Reference

Executes an event loop on a separate thread. More...

#include <EventLoopRunner.h>

Public Member Functions

void ExecAsync (std::function< void(wpi::uv::Loop &)> func)
 Run a function asynchronously (once) on the loop. More...
 
void ExecSync (std::function< void(wpi::uv::Loop &)> func)
 Run a function synchronously (once) on the loop. More...
 

Detailed Description

Executes an event loop on a separate thread.

Member Function Documentation

void wpi::EventLoopRunner::ExecAsync ( std::function< void(wpi::uv::Loop &)>  func)

Run a function asynchronously (once) on the loop.

This is safe to call from any thread, but is NOT safe to call from the provided function (it will deadlock).

Parameters
funcfunction to execute on the loop
void wpi::EventLoopRunner::ExecSync ( std::function< void(wpi::uv::Loop &)>  func)

Run a function synchronously (once) on the loop.

This is safe to call from any thread, but is NOT safe to call from the provided function (it will deadlock). This does not return until the function finishes executing.

Parameters
funcfunction to execute on the loop

The documentation for this class was generated from the following file: