This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CC3235MODASF:线程属性和参数

Guru**** 2529560 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/wi-fi-group/wifi/f/wi-fi-forum/935784/cc3235modasf-thread-attributes-and-params

器件型号:CC3235MODASF

您好...

我有疑问。

我想创建一个例程,在一行中减小线程创建代码的大小,以简化代码...

pthread_t CreateThread (int pri、int stack、void *(* start)(void *)、void * params)
{
pthread_t mypThread =(pthread_t) NULL;
pthread_attr_t mypAttrs;
struct sched_param mypParams;

pthread_attr_init_pri (&mypattrpriority
= myshit_attrs);struct psched_params;psched_params

int32_t
ret = pthread_attr_setschedparam (&mypAttrs、&mypParams);
ret |= pthread_attr_setstacksize (&mypAttrs、stack);
ret |= pthread_create (&mypThread、 &mypAttrs、start、params);

返回 mypThread;
}

我的问题是"mypAttrs"和"struct sched_param mypParams"在函数退出后必须是持久性的?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Mauro、

    不需要、它们不需要是持久的。

    此致、

    本·M