📄 rvthread.h
字号:
{notes:
{note: This works for all threads regardless of how they were created.}
{note: The exact time of suspension is based on the operating system and the
resolution of the system clock.}
}
}
$*/
/*$
{function:
{name: RvThreadGetOsName}
{superpackage: Thread}
{include: rvthread.h}
{description:
{p: Gets the name of a thread as seen by the operating system.}
}
{proto: RvStatus RvThreadGetOsName(RvThreadId id, RvChar *buf, RvInt32 size);}
{params:
{param: {n: id} {d: Thread ID.}}
{param: {n: buf} {d: Pointer to buffer where the name will be copied.}}
{param: {n: size} {d: Size of the buffer.}}
}
{returns: RV_OK if successful otherwise an error code.}
{notes:
{note: This works for all threads regardless of how they were created.}
{note: If the buffer is too small for the name the name will be truncated.}
{note: Only works on threads that exist (are executing).}
}
}
$*/
/*$
{function:
{name: RvThreadGetOsPriority}
{superpackage: Thread}
{include: rvthread.h}
{description:
{p: Gets the priority of a thread as seen by the operating system.}
}
{proto: RvStatus RvThreadGetOsPriority(RvThreadId id, RvInt32 priority);}
{params:
{param: {n: id} {d: Thread ID.}}
{param: {n: priority} {d: Pointer to location where the priority value will be stored.}}
}
{returns: RV_OK if successful otherwise an error code.}
{notes:
{note: This works for all threads regardless of how they were created.}
{note: Only works on threads that exist (are executing).}
}
}
$*/
/*$
{function:
{name: RvThreadGetName}
{superpackage: Thread}
{include: rvthread.h}
{description:
{p: Gets the name of a thread.}
}
{proto: RvChar *RvThreadGetName(RvThread *th);}
{params:
{param: {n: th} {d: Pointer to thread object to get the name of.}}
}
{returns: A pointer to the thread name string.}
{notes:
{note: The pointer returned is only valid until the thread is destructed.}
}
}
$*/
/*$
{function:
{name: RvThreadSetName}
{superpackage: Thread}
{include: rvthread.h}
{description:
{p: Sets the name of a thread.}
}
{proto: RvStatus RvThreadSetName(RvThread *th, RvChar *name);}
{params:
{param: {n: th} {d: Pointer to thread object to set the name of.}}
{param: {n: name} {d: Pointer string which constains the thread name.}}
}
{returns: RV_OK if successful otherwise an error code.}
{notes:
{note: A copy of the string passed in is made. The maximum size of the
the string is RV_THREAD_MAX_NAMESIZE and names that are too long
will be truncated.}
{note: The name can not be changed once a thread has been created.}
}
}
$*/
/*$
{function:
{name: RvThreadSetStack}
{superpackage: Thread}
{include: rvthread.h}
{description:
{p: Sets the stack information for a thread.}
}
{proto: RvStatus RvThreadSetStack(RvThread *th, void *stackaddr, RvInt32 stacksize);}
{params:
{param: {n: th} {d: Pointer to thread object to set the stack information for.}}
{param: {n: stackaddr} {d: Address of memory to use for stack (NULL means to allocate it).}}
{param: {n: stacksize} {d: Size of the stack.}}
}
{returns: RV_OK if successful otherwise an error code.}
{notes:
{note: The stack information can not be changed once a thread has been created.}
{note: If stackaddr is set to NULL, the amount of stack space used for internal overhead
will be allocated in addition to the requested stack size.}
{note: If stackaddr is set to NULL and the stacksize is set to 0, the default
stack settings will be used (see rvccoreconfig.h).}
}
}
$*/
/*$
{function:
{name: RvThreadSetPriority}
{superpackage: Thread}
{include: rvthread.h}
{description:
{p: Sets the stack priority for a thread.}
}
{proto: RvStatus RvThreadSetPriority(RvThread *th, RvInt32 priority);}
{params:
{param: {n: th} {d: Pointer to thread object to set the priority of.}}
{param: {n: priority} {d: Priority to set thread to.}}
}
{returns: RV_OK if successful otherwise an error code.}
}
$*/
/*$
{function:
{name: RvThreadGetAttr}
{superpackage: Thread}
{include: rvthread.h}
{description:
{p: Gets the current attributes for a thread.}
}
{proto: RvStatus RvThreadSetAttr(RvThread *th, RvThreadAttr *attr);}
{params:
{param: {n: th} {d: Pointer to thread object to get the attributes of.}}
{param: {n: attr} {d: Pointer to OS speicific thread attributes structure where the values will be copied.}}
}
{returns: RV_OK if successful otherwise an error code.}
{notes:
{note: Information about the attributes structure and its settings can be found in
the rvccoreconfig.h and rvthread.h file.}
}
}
$*/
/*$
{function:
{name: RvThreadSetAttr}
{superpackage: Thread}
{include: rvthread.h}
{description:
{p: Sets the attributes for a thread.}
}
{proto: RvStatus RvThreadSetAttr(RvThread *th, RvThreadAttr *attr);}
{params:
{param: {n: th} {d: Pointer to thread object to set the attributes of.}}
{param: {n: attr} {d: Pointer to OS speicific thread attributes to begin using (NULL = use defaults).}}
}
{returns: RV_OK if successful otherwise an error code.}
{notes:
{note: The attributes can not be changed once a thread has been created.}
{note: The default values for these attributes are set in rvccoreconfig.h.
Further information about these attributes can be found in that file and
the rvthread.h file.}
}
}
$*/
/*$
{function:
{name: RvThreadCreateVar}
{superpackage: Thread}
{include: rvthread.h}
{description:
{p: Creates a thread specific variable for all threads.}
}
{proto: RvStatus RvThreadCreateVar(RvThreadVarFunc exitfunc, RvChar *name, RvUint32 *index);}
{params:
{param: {n: exitfunc} {d: Pointer to a function which will be called for this variable when a thread exits (NULL = none).}}
{param: {n: name} {d: Pointer to a name string to identify the variable (NULL = no name).}}
{param: {n: index} {d: Pointer to a location to store the index of the variable created.}}
}
{returns: RV_OK if successful otherwise an error code.}
{notes:
{note: Only threads constructed with RvThreadConstruct or RvThreadConstructFromUserThread
may use thread specific variables.}
{note: For threads created with RvThreadConstructFromUserThread, the exit function
will be called when the thread calls RvThreadDestruct.}
{note: The maximum number of thread specific variables is RV_THREAD_MAX_VARS and is
configured in the rvccoreconfig.h file.}
{note: A copy of the name string passed in is made. The maximum size of the
the string is RV_THREAD_MAX_VARNAMESIZE and names that are too long
will be truncated.}
}
}
$*/
/*$
{function:
{name: RvThreadDeleteVar}
{superpackage: Thread}
{include: rvthread.h}
{description:
{p: Deletes a thread specific variable for all threads.}
}
{proto: RvStatus RvThreadDeleteVar(RvUint32 index);}
{params:
{param: {n: exitfunc} {d: Pointer to a function which will be called for this variable when a thread exits (NULL = none).}}
{param: {n: index} {d: Index of thread specific variable to be deleted.}}
}
{returns: RV_OK if successful otherwise an error code.}
{notes:
{note: Exit functions for the variable will NOT be called.}
}
}
$*/
/*$
{function:
{name: RvThreadSetVar}
{superpackage: Thread}
{include: rvthread.h}
{description:
{p: Sets the value of a thread specific variable for the current thread.}
}
{proto: RvStatus RvThreadSetVar(RvUint32 index, void *value);}
{params:
{param: {n: index} {d: Index of thread specific variable to be set.}}
{param: {n: value} {d: Value to set variable to.}}
}
{returns: RV_OK if successful otherwise an error code.}
{notes:
{note: Only threads constructed with RvThreadConstruct or RvThreadConstructFromUserThread
may use thread specific variables.}
}
}
$*/
/*$
{function:
{name: RvThreadGetVar}
{superpackage: Thread}
{include: rvthread.h}
{description:
{p: Gets the value of a thread specific variable for the current thread.}
}
{proto: RvStatus RvThreadSetVar(RvUint32 index, void **value);}
{params:
{param: {n: index} {d: Index of thread specific variable to be retrieved.}}
{param: {n: value} {d: Pointer to a location to store the current value of the variable.}}
}
{returns: RV_OK if successful otherwise an error code.}
{notes:
{note: Only threads constructed with RvThreadConstruct or RvThreadConstructFromUserThread
may use thread specific variables.}
}
}
$*/
/*$
{function:
{name: RvThreadFindVar}
{superpackage: Thread}
{include: rvthread.h}
{description:
{p: Finds the index of a thread specific variable by its name.}
}
{proto: RvStatus RvThreadFindVar(RvChar *name, RvUint32 *index); }
{params:
{param: {n: name} {d: Pointer to a name string of the variable to find.}}
{param: {n: index} {d: Pointer to a location to store the index of the variable found.}}
}
{returns: RV_OK if successful otherwise an error code.}
{notes:
{note: If multiple variables have the same name, the first one found
will be returned.}
}
}
$*/
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -