// create thread 3 - should be rejected
err = fosa_thread_create (&tid3, &th_attr, thread_code, (void *)3);
printf("creating thread 3 (rejected=%d), err=%d\n",
- (err == -4), err);
+ (err == FOSA_EREJECT), err);
err = frsh_thread_attr_destroy(&th_attr);
printf("thread attributes object destroyed, err=%d\n",err);
assert(err == 0);
- sleep (4);
+ sleep (5);
//////////////////////////////////////////////////////////////
// 2c) Change appsched params
static void *thread_code (void * arg)
{
- struct timespec ts = {5, 0};
+ struct timespec ts = {2, 0};
int err, i;
char whoami[] = "who am i?";
int reply;
+ size_t reply_size;
printf("Thread %d starts\n", (int)arg);
for (i=1;i<50;i++) {
assert(err == 0);
err = fosa_ads_invoke_withdata
- (whoami, sizeof(whoami), (void *)&reply, NULL);
+ (whoami, sizeof(whoami), (void *)&reply, &reply_size);
printf("who am I, correct?: %d, err=%d\n", reply == (int)arg, err);
assert(err == 0);
unsigned int i, index;
frsh_sched_data_t *frsh = (frsh_sched_data_t *)sched_data;
appsched_params_t params;
+ size_t size;
printf ("CALLBACK: %s \n", __func__);
err = fosa_adsactions_add_reject(actions, thread);
assert(err == 0);
} else {
- // Get the priority for the new thread (NULL is possible?)
- err = fosa_ads_get_appsched_params(thread, (void *)¶ms, NULL);
+ // Get the priority for the new thread
+ size = sizeof(params);
+ err = fosa_ads_get_appsched_params(thread, (void *)¶ms, &size);
assert(err == 0);
frsh->array_prio[index] = params.prio;
frsh->array_status[index] = 1;
-
- err = fosa_adsactions_add_activate(actions, thread, params.prio);
- assert(err == 0);
}
}