[docs] Add Missing JNI docs from C++ (NFC) (#6139)

This commit is contained in:
m10653
2024-01-02 23:13:46 -05:00
committed by GitHub
parent 5c424248c4
commit 01fb98baaa
6 changed files with 404 additions and 0 deletions

View File

@@ -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();