copy_of_signalset=sch_thread_data->sch_signal_set;
// unlock the scheduler mutex before waiting
- CHK(pthread_mutex_lock(&(sch_thread_data->sch_mutex)));
+ CHK(pthread_mutex_unlock(&(sch_thread_data->sch_mutex)));
// execute pending scheduling actions and wait for next event
err=posix_appsched_execute_actions
if (!sched_actions.suspended && !sched_actions.activated) {
CHK(posix_appsched_actions_addactivate
(&(sched_actions.actions),event.thread));
- }
+ }
}
}
break;
clk,
&sched_actions,
¤t_time);
- // t.b.d. check if state of thread is suspended by default
+ // t.b.d. check if state of thread is suspended by default
break;
case POSIX_APPSCHED_TIMEOUT:
sch_thread_data->scheduler_ops.timeout
int err;
struct sched_param param;
-#ifdef FULL_ERROR_CHECKING
+#ifdef FULL_ERROR_CHECKING
// check for NULL scheduler operations
if (scheduler_ops==NULL) {
return EINVAL;
(frsh_thread_attr_t *attr,
bool appscheduled)
{
- return pthread_attr_setschedpolicy(attr,SCHED_APP);
+ int error_code;
+
+ // set the application-defined scheduler thread
+ error_code=pthread_attr_setappscheduler(attr,scheduler_thread_id);
+ if (error_code!=0) return error_code;
+
+ if (appscheduled) {
+ return pthread_attr_setschedpolicy(attr,SCHED_APP);
+ } else {
+ return pthread_attr_setschedpolicy(attr,SCHED_FIFO);
+ }
}
/**
fosa_ads_actions_t *sched_actions,
frsh_thread_id_t thread)
{
-#ifdef FULL_ERROR_CHECKING
+#ifdef FULL_ERROR_CHECKING
// check errors
if (!pthread_equal(pthread_self(),scheduler_thread_id)) {
return FOSA_EPOLICY;
frsh_thread_id_t thread,
fosa_ads_urgency_t urgency)
{
-#ifdef FULL_ERROR_CHECKING
+#ifdef FULL_ERROR_CHECKING
// check errors
struct sched_param param;
int policy;
fosa_ads_actions_t *sched_actions,
frsh_thread_id_t thread)
{
-#ifdef FULL_ERROR_CHECKING
+#ifdef FULL_ERROR_CHECKING
// check errors
struct sched_param param;
int policy;
fosa_clock_id_t clock_id,
const struct timespec *at_time)
{
-#ifdef FULL_ERROR_CHECKING
+#ifdef FULL_ERROR_CHECKING
// check errors
struct sched_param param;
int policy;
{
int i;
-#ifdef FULL_ERROR_CHECKING
+#ifdef FULL_ERROR_CHECKING
// check errors
if (!pthread_equal(pthread_self(),scheduler_thread_id)) {
return FOSA_EPOLICY;
struct explicit_call_info * call_info;
int error_code;
-#ifdef FULL_ERROR_CHECKING
+#ifdef FULL_ERROR_CHECKING
// check errors
if (pthread_equal(pthread_self(),scheduler_thread_id)) {
return FOSA_EPOLICY;