static void mid_task(rtems_task_argument arg) { test_context *ctx = &test_instance; obtain_sema(ctx->sem_b); obtain_sema(ctx->sem_a); }
static void high_task(rtems_task_argument arg) { test_context *ctx = &test_instance; start_task(ctx->inversion, inversion_task); obtain_sema(ctx->sem_b); }
static void Init(rtems_task_argument arg) { test_context *ctx = &test_instance; TEST_BEGIN(); ctx->low = rtems_task_self(); create_task(&ctx->mid, 3); create_task(&ctx->high, 1); create_task(&ctx->inversion, 2); create_sema(&ctx->sem_a); create_sema(&ctx->sem_b); obtain_sema(ctx->sem_a); start_task(ctx->mid, mid_task); start_task(ctx->high, high_task); /* * Here we see that the priority of the high priority task blocked on * semaphore B propagated to the low priority task owning semaphore A * on which the owner of semaphore B depends. */ assert_prio(ctx->low, 1); assert_prio(ctx->mid, 1); assert_prio(ctx->high, 1); assert_prio(ctx->inversion, 2); TEST_END(); rtems_test_exit(0); }
static void Init(rtems_task_argument arg) { test_context *ctx = &test_instance; TEST_BEGIN(); ctx->low = rtems_task_self(); create_task(&ctx->mid, 3); create_task(&ctx->high, 1); create_task(&ctx->inversion, 2); create_sema(&ctx->sem_a); create_sema(&ctx->sem_b); obtain_sema(ctx->sem_a); start_task(ctx->mid, mid_task); start_task(ctx->high, high_task); }