Set alarm

This commit is contained in:
Michael Cook
2021-10-18 22:04:19 +00:00
committed by Melissa
parent 2800fbe0d5
commit 69fc902b52
7 changed files with 46 additions and 33 deletions
+2 -8
View File
@@ -40,15 +40,9 @@ typedef struct {
static nfapi_params_t nfapi_params = {0};
void set_thread_priority(int priority) {
//printf("%s(priority:%d)\n", __FUNCTION__, priority);
set_priority(priority);
pthread_attr_t ptAttr;
struct sched_param schedParam;
schedParam.__sched_priority = priority; //79;
if(sched_setscheduler(0, SCHED_RR, &schedParam) != 0) {
printf("Failed to set scheduler to SCHED_RR\n");
}
if(pthread_attr_setschedpolicy(&ptAttr, SCHED_RR) != 0) {
printf("Failed to set pthread sched policy SCHED_RR\n");
}
+2 -7
View File
@@ -218,14 +218,9 @@ void pnf_nfapi_trace(nfapi_trace_level_t nfapi_level, const char *message, ...)
}
void pnf_set_thread_priority(int priority) {
set_priority(priority);
pthread_attr_t ptAttr;
struct sched_param schedParam;
schedParam.__sched_priority = priority;
if(sched_setscheduler(0, SCHED_RR, &schedParam) != 0) {
printf("failed to set SCHED_RR\n");
}
if(pthread_attr_setschedpolicy(&ptAttr, SCHED_RR) != 0) {
printf("failed to set pthread SCHED_RR %d\n", errno);
}