OpenHarmony开发者论坛

标题: VScode [打印本页]

作者: zhangzihan    时间: 2024-4-6 13:59
标题: VScode
在内部编程的VS code IntelliSense案例程序中创建一个线程养将其加入活跃线程组中
osThreadId-to-sThreadNew(oSThreadFunc-t-func,Void*argument,constosTreadAttr-t*attr)
func线程要运行的函数
argument指针,指向传递给线程函数的参数

为什么不能在中断服务调用该函数
作者: dragon    时间: 2024-4-6 17:25
标题: VScode
您的问题表述有点难以读懂。

是想问osThreadNew函数为什么不能在中断服务中调用么?

看了一下OH源码,好像并没有这个约束


/**
* @brief Creates an active thread.
*
* The task priority ranges from 9 (highest priority) to 38 (lowest priority). {@code LOSCFG_BASE_CORE_TSK_LIMIT} declared in target_config.h specifies the
maximum number of tasks running in this system.
* @param func Indicates the entry of the thread callback function.
* @param argument Indicates the pointer to the argument passed to the thread.
* @param attr Indicates the thread attributes.
* @return Returns the thread ID; returns NULL in the case of an error.
* @since 1.0
* @version 1.0
*/
osThreadId_t osThreadNew (osThreadFunc_t func, void *argument, const osThreadAttr_t *attr);






欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5