xiuos/Ubiquitous/RT_Thread/micropython/docs/spec-librarys/rtthread.md

24 lines
491 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## **rtthread** 系统相关函数
**rtthread** 模块提供了与 RT-Thread 操作系统相关的功能,如查看栈使用情况等。
### 函数
#### rtthread.current_tid()
返回当前线程的 id 。
#### rtthread.is_preempt_thread()
返回是否是可抢占线程。
### 示例
```
>>> import rtthread
>>>
>>> rtthread.is_preempt_thread() # determine if it's a preemptible thread
True
>>> rtthread.current_tid() # current thread id
268464956
>>>
```