]> rtime.felk.cvut.cz Git - frescor/fosa.git/blobdiff - src_aquosa/fosa_threads_and_signals.c
Final update to phase II API.
[frescor/fosa.git] / src_aquosa / fosa_threads_and_signals.c
index 8b62f294375ae9136e2dfe4059283b902f4fe40a..7cb0378437e6c204b2f329c73e999caa57bb2f85 100644 (file)
@@ -171,7 +171,7 @@ int fosa_thread_attr_init(fosa_thread_attr_t *attr)
  * pointed to by attr, and deallocate any system resources allocated for it
  * 
  * Returns 0
- */
+ **/
 int fosa_thread_attr_destroy(fosa_thread_attr_t *attr)
 {
        fosa_thread_id_t self;
@@ -198,7 +198,7 @@ int fosa_thread_attr_destroy(fosa_thread_attr_t *attr)
  * return 0 if successful, or the following error code:
  *    FOSA_EINVAL: the specified stacksize  value is not supported in
  *            this implementation
- */
+ **/
 int fosa_thread_attr_set_stacksize(fosa_thread_attr_t *attr,
                                   size_t stacksize)
 {
@@ -221,7 +221,7 @@ int fosa_thread_attr_set_stacksize(fosa_thread_attr_t *attr,
  * minimum stack size stored in the thread attributes object attr.
  * 
  * return 0
- */
+ **/
 int fosa_thread_attr_get_stacksize(const fosa_thread_attr_t *attr,
                                   size_t *stacksize)
 {
@@ -528,19 +528,10 @@ int fosa_thread_attr_get_prio(const fosa_thread_attr_t *attr, int *prio)
 int fosa_thread_set_prio(fosa_thread_id_t tid, int prio)
 {
        struct sched_param param;
-       int error;
 
        param.sched_priority=prio;
-       if (tid.linux_pid == tid.linux_tid)
-               error = sched_setscheduler(tid.linux_pid,
-                                          SCHED_RR,
-                                          &param);
-       else
-               error = pthread_setschedparam(tid.pthread_id,
-                                              SCHED_RR,
-                                              &param);
 
-       return error;
+       return sched_setscheduler(0, SCHED_RR, &param);
 }
 
 /**
@@ -553,18 +544,12 @@ int fosa_thread_set_prio(fosa_thread_id_t tid, int prio)
  * 
  * Returns 0
  **/
-int fosa_thread_get_prio (fosa_thread_id_t tid, int *prio)
+int fosa_thread_get_prio(fosa_thread_id_t tid, int *prio)
 {
        struct sched_param param;
-       int policy, error;
-
-       if (tid.linux_pid == tid.linux_tid)
-               error = sched_getparam(tid.linux_pid, &param);
-       else
-               error = pthread_getschedparam(tid.pthread_id,
-                                             &policy,
-                                             &param);
+       int error;
 
+       error = sched_getparam(0, &param);
        *prio = param.sched_priority;
 
        return error;
@@ -747,3 +732,4 @@ int fosa_signal_timedwait(fosa_signal_t set[], int size,
 
        return 0;
 }
+