通過這段代碼設定的優先級只能再超級權限下使用,非超級權限存在會創建執行緒失敗, 去掉優先級設定 非超級權限用會導致效率下降,讀寫DMA超時,求大神指導下,謝謝
pthread_attr_t attr;
struct sched_param param;
ctx->int_call_back=fun_int;
if(pthread_attr_init(&attr)!=0)
return INT_THREAD_ATTR_SET_FAILED;
param.sched_priority = sched_get_priority_max(SCHED_RR);
pthread_attr_setschedpolicy(&attr,SCHED_RR);
pthread_attr_setschedparam(&attr,¶m);
pthread_attr_setinheritsched(&attr,PTHREAD_EXPLICIT_SCHED);
ctx->int_arg=in_arg;
if(pthread_create(&ctx->int_tid, &attr, __int_thread, dev)!=0)
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/9276.html
標籤:驅動開發/核心開發
