Changeset fbd08066 in rtems


Ignore:
Timestamp:
02/07/19 06:46:38 (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
4e686261
Parents:
0fb52ce
git-author:
Sebastian Huber <sebastian.huber@…> (02/07/19 06:46:38)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/07/19 07:48:18)
Message:

score: Fix plain priority thread queues (SMP)

We must add/remove the priority queue to the FIFO of priority queues.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/threadqops.c

    r0fb52ce rfbd08066  
    361361#if defined(RTEMS_SMP)
    362362      case PRIORITY_ACTION_ADD:
     363        if ( _Priority_Is_empty( &priority_queue->Queue ) ) {
     364          _Chain_Append_unprotected( &heads->Heads.Fifo, &priority_queue->Node );
     365        }
     366
    363367        _Priority_Plain_insert(
    364368          &priority_queue->Queue,
     
    372376          &scheduler_node->Wait.Priority.Node
    373377        );
     378
     379        if ( _Priority_Is_empty( &priority_queue->Queue ) ) {
     380          _Chain_Extract_unprotected( &priority_queue->Node );
     381        }
    374382        break;
    375383#endif
  • testsuites/smptests/smpmutex01/init.c

    r0fb52ce rfbd08066  
    688688}
    689689
     690static void test_two_scheduler_instances_sem_with_inheritance(test_context *ctx)
     691{
     692  sem_obtain(ctx);
     693
     694  request(ctx, B_4, REQ_MTX_OBTAIN);
     695  check_generations(ctx, B_4, NONE);
     696  assert_prio_by_scheduler(ctx, B_4, SCHED_A, PRIO_NONE);
     697  assert_prio_by_scheduler(ctx, B_4, SCHED_B, 4);
     698
     699  request(ctx, B_4, REQ_SEM_OBTAIN_RELEASE);
     700  check_generations(ctx, NONE, NONE);
     701
     702  request(ctx, A_1, REQ_MTX_OBTAIN);
     703  check_generations(ctx, NONE, NONE);
     704  assert_prio_by_scheduler(ctx, B_4, SCHED_A, 1);
     705  assert_prio_by_scheduler(ctx, B_4, SCHED_B, 4);
     706
     707  sem_release(ctx);
     708  sync_with_helper(ctx);
     709  check_generations(ctx, B_4, NONE);
     710
     711  request(ctx, B_4, REQ_MTX_RELEASE);
     712  check_generations(ctx, B_4, A_1);
     713  assert_prio_by_scheduler(ctx, B_4, SCHED_A, PRIO_NONE);
     714  assert_prio_by_scheduler(ctx, B_4, SCHED_B, 4);
     715
     716  request(ctx, A_1, REQ_MTX_RELEASE);
     717  check_generations(ctx, A_1, NONE);
     718}
     719
     720static void test_two_scheduler_instances_sem_with_inheritance_timeout(test_context *ctx)
     721{
     722  sem_obtain(ctx);
     723
     724  request(ctx, B_4, REQ_MTX_OBTAIN);
     725  check_generations(ctx, B_4, NONE);
     726  assert_prio_by_scheduler(ctx, B_4, SCHED_A, PRIO_NONE);
     727  assert_prio_by_scheduler(ctx, B_4, SCHED_B, 4);
     728
     729  request(ctx, B_4, REQ_SEM_OBTAIN_RELEASE);
     730  check_generations(ctx, NONE, NONE);
     731
     732  request(ctx, A_1, REQ_MTX_OBTAIN_TIMEOUT);
     733  check_generations(ctx, NONE, NONE);
     734  assert_prio_by_scheduler(ctx, B_4, SCHED_A, 1);
     735  assert_prio_by_scheduler(ctx, B_4, SCHED_B, 4);
     736  wait();
     737  check_generations(ctx, A_1, NONE);
     738  assert_prio_by_scheduler(ctx, B_4, SCHED_A, PRIO_NONE);
     739  assert_prio_by_scheduler(ctx, B_4, SCHED_B, 4);
     740
     741  sem_release(ctx);
     742  sync_with_helper(ctx);
     743  check_generations(ctx, B_4, NONE);
     744
     745  request(ctx, B_4, REQ_MTX_RELEASE);
     746  check_generations(ctx, B_4, NONE);
     747  assert_prio_by_scheduler(ctx, B_4, SCHED_A, PRIO_NONE);
     748  assert_prio_by_scheduler(ctx, B_4, SCHED_B, 4);
     749}
     750
    690751static void test_simple_inheritance_two_scheduler_instances(test_context *ctx)
    691752{
     
    10111072    test_mixed_queue_two_scheduler_instances(ctx);
    10121073    test_mixed_queue_two_scheduler_instances_sem_only(ctx);
     1074    test_two_scheduler_instances_sem_with_inheritance(ctx);
     1075    test_two_scheduler_instances_sem_with_inheritance_timeout(ctx);
    10131076    test_simple_inheritance_two_scheduler_instances(ctx);
    10141077    test_nested_inheritance_two_scheduler_instances(ctx);
Note: See TracChangeset for help on using the changeset viewer.