001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004
005package org.wpilib.hardware.hal;
006
007/**
008 * Threads HAL JNI Functions.
009 *
010 * @see "wpi/hal/Threads.h"
011 */
012public class ThreadsJNI extends JNIWrapper {
013  /**
014   * Gets the current thread's priority.
015   *
016   * <p>Priorities range from 0 to 99 where 0 is non-real-time, 1-99 are real-time, and 99 is
017   * highest priority. See "man 7 sched" for details.
018   *
019   * @return The current thread's priority.
020   * @see "HAL_GetCurrentThreadPriority"
021   */
022  public static native int getCurrentThreadPriority();
023
024  /**
025   * Sets the current thread's priority.
026   *
027   * <p>Priorities range from 0 to 99 where 0 is non-real-time, 1-99 are real-time, and 99 is
028   * highest priority. See "man 7 sched" for details.
029   *
030   * @param priority The priority.
031   * @return True on success.
032   * @see "HAL_SetCurrentThreadPriority"
033   */
034  public static native boolean setCurrentThreadPriority(int priority);
035
036  /** Utility class. */
037  private ThreadsJNI() {}
038}