pub unsafe extern "C" fn hal_create_thread(
    name: *const c_char,
    period_nsec: c_ulong,
    uses_fp: c_int
) -> c_int
Expand description

hal_create_thread() establishes a realtime thread that will execute one or more HAL functions periodically. ‘name’ is the name of the thread, which must be unique in the system. It must be no longer than HAL_NAME_LEN. ‘period_nsec’ is the desired period of the thread, in nano- seconds. All threads must run at an integer multiple of the fastest thread, and the fastest thread must be created first. In general, threads should be created in order, from the fastest to the slowest. HAL assigns decreasing priorities to threads that are created later, so creating them from fastest to slowest results in rate monotonic priority scheduling, usually a good thing. ‘uses_fp’ should be non-zero if the thread will call any functions that use floating point. In general, it should be non-zero for most threads, with the possible exception of the very fastest, most critical thread in a system. On success, hal_create_thread() returns a positive integer thread ID. On failure, returns an error code as defined above. Call only from realtime init code, not from user space or realtime code.