VEXcode IQ C++ Unofficial documentation for version 3.0.4.1
Loading...
Searching...
No Matches
vex::semaphore Class Reference

Use this class to synchronize access to resources. More...

#include <vex_task.h>

Public Member Functions

void lock ()
 Attempts to lock the semaphore. If the semaphore is previously locked, it will block until the semaphore is unlocked.
 
void lock (uint32_t time)
 Attempts to lock the semaphore. If the semaphore is previously locked, it will block until the timeout has expired or the semaphore is unlocked.
 
void unlock ()
 Unlocks a locked semaphore.
 
bool owner ()
 Checks to see if the semaphore was locked and is owned by the current task.
 

Detailed Description

Use this class to synchronize access to resources.

Definition at line 153 of file vex_task.h.

Member Function Documentation

◆ lock()

void vex::semaphore::lock ( uint32_t time)

Attempts to lock the semaphore. If the semaphore is previously locked, it will block until the timeout has expired or the semaphore is unlocked.

Parameters
timeThe maximum amount of time to wait for the semaphore to be unlocked in milliseconds.

◆ owner()

bool vex::semaphore::owner ( )

Checks to see if the semaphore was locked and is owned by the current task.

Returns
Returns a true Boolean if the semaphore was locked and is owned by the current task.

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