liteos中任务入口函数的原型是什么
时间: 2024-06-14 22:03:45 浏览: 15
在LiteOS中,任务入口函数的原型是osThreadFunc_t,其定义如下:
```c
typedef void (*osThreadFunc_t) (void *argument);
```
该函数指针类型的参数为void指针类型,返回值为void类型。任务入口函数需要接收一个void指针类型的参数,该参数可以用来传递任务所需的参数。
相关问题
pthread_create()的函数原型是什么
pthread_create()函数的原型如下:
```c
int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine) (void *), void *arg);
```
该函数用于创建一个新的线程,并将其执行的起始点设置为指定的函数。它接受四个参数:
1. `thread`:指向线程标识符的指针,用于存储新创建的线程的标识符。
2. `attr`:指向线程属性的指针,用于设置线程的属性。可以传入NULL,表示使用默认属性。
3. `start_routine`:指向线程执行的函数的指针。该函数必须具有以下形式:`void* function_name(void* arg)`,其中`arg`是传递给线程函数的参数。
4. `arg`:传递给线程函数的参数。
成功创建线程时,pthread_create()函数将返回0;否则,返回一个非零错误码,表示创建线程失败。
NtCreateThreadEx函数原型是什么
NtCreateThreadEx函数的原型是:
NTSTATUS NtCreateThreadEx(
PHANDLE ThreadHandle,
ACCESS_MASK DesiredAccess,
POBJECT_ATTRIBUTES ObjectAttributes,
HANDLE ProcessHandle,
PVOID StartRoutine,
PVOID Argument,
ULONG CreateFlags,
ULONG_PTR ZeroBits,
SIZE_T StackSize,
SIZE_T MaximumStackSize,
PVOID AttributeList
);
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)