* 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;
* 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)
{
* 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)
{
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,
- ¶m);
- else
- error = pthread_setschedparam(tid.pthread_id,
- SCHED_RR,
- ¶m);
- return error;
+ return sched_setscheduler(0, SCHED_RR, ¶m);
}
/**
*
* 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, ¶m);
- else
- error = pthread_getschedparam(tid.pthread_id,
- &policy,
- ¶m);
+ int error;
+ error = sched_getparam(0, ¶m);
*prio = param.sched_priority;
return error;
return 0;
}
+