Ignore:
Timestamp:
Mar 17, 2015, 9:32:20 AM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
ac8339a
Parents:
8e10f62
git-author:
Sebastian Huber <sebastian.huber@…> (03/17/15 09:32:20)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/17/15 09:32:57)
Message:

testsupport: Add worker setup handler

Add rtems_test_parallel_get_task_id().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/smptests/smpatomic01/init.c

    r8e10f62 r8c7eb00  
    419419  }, {
    420420    .init = test_atomic_flag_init,
    421     .body =test_atomic_flag_body,
    422     .fini =test_atomic_flag_fini
     421    .body = test_atomic_flag_body,
     422    .fini = test_atomic_flag_fini
    423423  }, {
    424424    .init = test_atomic_sub_init,
    425     .body =test_atomic_sub_body,
    426     .fini =test_atomic_sub_fini
     425    .body = test_atomic_sub_body,
     426    .fini = test_atomic_sub_fini
    427427  }, {
    428428    .init = test_atomic_compare_exchange_init,
    429     .body =test_atomic_compare_exchange_body,
    430     .fini =test_atomic_compare_exchange_fini
     429    .body = test_atomic_compare_exchange_body,
     430    .fini = test_atomic_compare_exchange_fini
    431431  }, {
    432432    .init = test_atomic_or_and_init,
    433     .body =test_atomic_or_and_body,
    434     .fini =test_atomic_or_and_fini
     433    .body = test_atomic_or_and_body,
     434    .fini = test_atomic_or_and_fini
    435435  }, {
    436436    .init = test_atomic_fence_init,
    437     .body =test_atomic_fence_body,
    438     .fini =test_atomic_fence_fini
     437    .body = test_atomic_fence_body,
     438    .fini = test_atomic_fence_fini
    439439  },
    440440};
    441441
     442static void setup_worker(
     443  rtems_test_parallel_context *base,
     444  size_t worker_index,
     445  rtems_id worker_id
     446)
     447{
     448  rtems_status_code sc;
     449  rtems_task_priority prio;
     450
     451  sc = rtems_task_set_priority(worker_id, WORKER_PRIORITY, &prio);
     452  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     453}
     454
    442455static void Init(rtems_task_argument arg)
    443456{
     
    448461  rtems_test_parallel(
    449462    &ctx->base,
    450     WORKER_PRIORITY,
     463    setup_worker,
    451464    &test_jobs[0],
    452465    RTEMS_ARRAY_SIZE(test_jobs)
Note: See TracChangeset for help on using the changeset viewer.