2 * \brief Implementace pomocnych funkci.
5 * \author Martin Prudek
7 * Implementace pomocnych funkci.
8 * Vetsinou pro komunikaci mezi vlakny, jejich sychronizaci a predavani priorit.
15 * nastavi prioritu a scheduler podle parametru
16 * funkce na konci vrati semafor, aby mohlo dojit k opetovne zmene parametru
17 * \param pointer na struct thread_sched_param
19 void set_priority(void * param){
20 struct sched_param sp;
21 struct thread_param *tp = ((struct thread_param*) param);
23 sp.sched_priority = tp->sch_prior; /*vysoka priorita*/
24 if(sched_setscheduler(0, tp->sch_policy, &sp) == -1) {
25 perror("pid sched_setscheduler failed");
27 sem_post(&thd_par_sem);