--- /dev/null
+/**
+ * \brief Implementace pomocnych funkci.
+ * \file misc.c
+ * \date Feb 1, 2015
+ * \author Martin Prudek
+ *
+ * Implementace pomocnych funkci.
+ * Vetsinou pro komunikaci mezi vlakny, jejich sychronizaci a predavani priorit.
+ */
+
+#include "misc.h"
+#include <sched.h>
+
+/**
+ * nastavi prioritu a scheduler podle parametru
+ * funkce na konci vrati semafor, aby mohlo dojit k opetovne zmene parametru
+ * \param pointer na struct thread_sched_param
+ */
+void set_priority(void * param){
+ struct sched_param sp;
+ struct thread_param *tp = ((struct thread_param*) param);
+
+ sp.sched_priority = tp->sch_prior; /*vysoka priorita*/
+ if(sched_setscheduler(0, tp->sch_policy, &sp) == -1) {
+ perror("pid sched_setscheduler failed");
+ }
+ sem_post(&thd_par_sem);
+}