Pthread_attr_t attr;
Struct sched_param param.
CTX - & gt; Int_call_back=fun_int;
If (pthread_attr_init (& amp; Attr)!=0)
Return INT_THREAD_ATTR_SET_FAILED;
Param. Sched_priority=sched_get_priority_max (SCHED_RR);
Pthread_attr_setschedpolicy (& amp; Attr, SCHED_RR);
Pthread_attr_setschedparam (& amp; Attr, & amp; Param);
Pthread_attr_setinheritsched (& amp; Attr, PTHREAD_EXPLICIT_SCHED);
CTX - & gt; Int_arg=in_arg;
If (pthread_create (& amp; CTX - & gt; Int_tid, & amp; Attr, __int_thread, dev)!=0)
CodePudding user response:
Mandatory set priority number, give it a try