WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
Synchronization.hpp File Reference
#include <climits>
#include <initializer_list>
#include <span>
#include "wpi/util/Synchronization.h"

Go to the source code of this file.

Classes

class  wpi::util::Event
 An atomic signaling event for synchronization. More...
class  wpi::util::Semaphore
 A semaphore for synchronization. More...
class  wpi::util::SignalObject< T >
 RAII wrapper for signaling handles. More...

Namespaces

namespace  wpi
namespace  wpi::util

Functions

WPI_EventHandle wpi::util::CreateEvent (bool manualReset=false, bool initialState=false)
 Creates an event.
void wpi::util::DestroyEvent (WPI_EventHandle handle)
 Destroys an event.
void wpi::util::SetEvent (WPI_EventHandle handle)
 Sets an event to signaled state.
void wpi::util::ResetEvent (WPI_EventHandle handle)
 Sets an event to non-signaled state.
WPI_SemaphoreHandle wpi::util::CreateSemaphore (int initialCount=0, int maximumCount=INT_MAX)
 Creates a semaphore.
void wpi::util::DestroySemaphore (WPI_SemaphoreHandle handle)
 Destroys a semaphore.
bool wpi::util::ReleaseSemaphore (WPI_SemaphoreHandle handle, int releaseCount=1, int *prevCount=nullptr)
 Releases N counts of a semaphore.
bool wpi::util::WaitForObject (WPI_Handle handle)
 Waits for an handle to be signaled.
bool wpi::util::WaitForObject (WPI_Handle handle, double timeout, bool *timedOut)
 Waits for an handle to be signaled, with timeout.
std::span< WPI_Handlewpi::util::WaitForObjects (std::span< const WPI_Handle > handles, std::span< WPI_Handle > signaled)
 Waits for one or more handles to be signaled.
std::span< WPI_Handlewpi::util::WaitForObjects (std::initializer_list< WPI_Handle > handles, std::span< WPI_Handle > signaled)
 Waits for one or more handles to be signaled.
std::span< WPI_Handlewpi::util::WaitForObjects (std::span< const WPI_Handle > handles, std::span< WPI_Handle > signaled, double timeout, bool *timedOut)
 Waits for one or more handles to be signaled, with timeout.
std::span< WPI_Handlewpi::util::WaitForObjects (std::initializer_list< WPI_Handle > handles, std::span< WPI_Handle > signaled, double timeout, bool *timedOut)
 Waits for one or more handles to be signaled, with timeout.
void wpi::util::CreateSignalObject (WPI_Handle handle, bool manualReset=false, bool initialState=false)
 Sets up signaling for an arbitrary handle.
void wpi::util::SetSignalObject (WPI_Handle handle)
 Sets a handle to signaled state.
void wpi::util::ResetSignalObject (WPI_Handle handle)
 Sets a handle to non-signaled state.
void wpi::util::DestroySignalObject (WPI_Handle handle)
 Cleans up signaling for a handle.

Variables

constexpr unsigned int wpi::util::kInvalidHandle = 0
 Constant representing an invalid handle.
constexpr int wpi::util::kHandleTypeEvent = 1
 Standard types for handles.
constexpr int wpi::util::kHandleTypeSemaphore = 2
constexpr int wpi::util::kHandleTypeCSBase = 3
constexpr int wpi::util::kHandleTypeNTBase = 16
constexpr int wpi::util::kHandleTypeHALBase = 48
constexpr int wpi::util::kHandleTypeUserBase = 80