mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[docs] Add Missing JNI docs from C++ (NFC) (#6139)
This commit is contained in:
@@ -82,18 +82,67 @@ public class WPIUtilJNI {
|
||||
|
||||
public static native long getSystemTime();
|
||||
|
||||
/**
|
||||
* Creates an event. Events have binary state (signaled or not signaled) and may be either
|
||||
* automatically reset or manually reset. Automatic-reset events go to non-signaled state when a
|
||||
* WaitForObject is woken up by the event; manual-reset events require ResetEvent() to be called
|
||||
* to set the event to non-signaled state; if ResetEvent() is not called, any waiter on that event
|
||||
* will immediately wake when called.
|
||||
*
|
||||
* @param manualReset true for manual reset, false for automatic reset
|
||||
* @param initialState true to make the event initially in signaled state
|
||||
* @return Event handle
|
||||
*/
|
||||
public static native int createEvent(boolean manualReset, boolean initialState);
|
||||
|
||||
/**
|
||||
* Destroys an event. Destruction wakes up any waiters.
|
||||
*
|
||||
* @param eventHandle event handle
|
||||
*/
|
||||
public static native void destroyEvent(int eventHandle);
|
||||
|
||||
/**
|
||||
* Sets an event to signaled state.
|
||||
*
|
||||
* @param eventHandle event handle
|
||||
*/
|
||||
public static native void setEvent(int eventHandle);
|
||||
|
||||
/**
|
||||
* Sets an event to non-signaled state.
|
||||
*
|
||||
* @param eventHandle event handle
|
||||
*/
|
||||
public static native void resetEvent(int eventHandle);
|
||||
|
||||
/**
|
||||
* Creates a semaphore. Semaphores keep an internal counter. Releasing the semaphore increases the
|
||||
* count. A semaphore with a non-zero count is considered signaled. When a waiter wakes up it
|
||||
* atomically decrements the count by 1. This is generally useful in a single-supplier,
|
||||
* multiple-consumer scenario.
|
||||
*
|
||||
* @param initialCount initial value for the semaphore's internal counter
|
||||
* @param maximumCount maximum value for the samephore's internal counter
|
||||
* @return Semaphore handle
|
||||
*/
|
||||
public static native int createSemaphore(int initialCount, int maximumCount);
|
||||
|
||||
/**
|
||||
* Destroys a semaphore. Destruction wakes up any waiters.
|
||||
*
|
||||
* @param semHandle semaphore handle
|
||||
*/
|
||||
public static native void destroySemaphore(int semHandle);
|
||||
|
||||
/**
|
||||
* Releases N counts of a semaphore.
|
||||
*
|
||||
* @param semHandle semaphore handle
|
||||
* @param releaseCount amount to add to semaphore's internal counter; must be positive
|
||||
* @return True on successful release, false on failure (e.g. release count would exceed maximum
|
||||
* value, or handle invalid)
|
||||
*/
|
||||
public static native boolean releaseSemaphore(int semHandle, int releaseCount);
|
||||
|
||||
static native long allocateRawFrame();
|
||||
|
||||
Reference in New Issue
Block a user