Changeset f830029 in rtems


Ignore:
Timestamp:
Apr 16, 2014, 2:06:05 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
10e613ba
Parents:
babb1a2c
git-author:
Sebastian Huber <sebastian.huber@…> (04/16/14 14:06:05)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/17/14 06:06:39)
Message:

doc: rtems_task_set_scheduler()

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/rtems/include/rtems/rtems/tasks.h

    rbabb1a2c rf830029  
    561561 * @brief Sets the scheduler of a task.
    562562 *
     563 * The scheduler of a task is initialized to the scheduler of the task that
     564 * created it.
     565 *
    563566 * @param[in] id Identifier of the task.  Use @ref RTEMS_SELF to select the
    564567 * executing task.
  • doc/user/smp.t

    rbabb1a2c rf830029  
    2020@item @code{rtems_scheduler_get_processor_set} - Get processor set of a scheduler
    2121@item @code{rtems_task_get_scheduler} - Get scheduler of a task
     22@item @code{rtems_task_set_scheduler} - Set scheduler of a task
    2223@item @code{rtems_task_get_affinity} - Get task processor affinity
    2324@item @code{rtems_task_set_affinity} - Set task processor affinity
     
    410411
    411412@c
     413@c rtems_task_set_scheduler
     414@c
     415@page
     416@subsection TASK_SET_SCHEDULER - Set scheduler of a task
     417
     418@subheading CALLING SEQUENCE:
     419
     420@ifset is-C
     421@example
     422rtems_status_code rtems_task_set_scheduler(
     423  rtems_id id,
     424  rtems_id scheduler_id
     425);
     426@end example
     427@end ifset
     428
     429@ifset is-Ada
     430@end ifset
     431
     432@subheading DIRECTIVE STATUS CODES:
     433
     434@code{@value{RPREFIX}SUCCESSFUL} - successful operation@*
     435@code{@value{RPREFIX}INVALID_ID} - invalid task or scheduler id@*
     436@code{@value{RPREFIX}INCORRECT_STATE} - the task is in the wrong state to
     437perform a scheduler change
     438
     439@subheading DESCRIPTION:
     440
     441Sets the scheduler of a task specified by @code{scheduler_id}.  The scheduler
     442of a task is initialized to the scheduler of the task that created it.
     443
     444@subheading NOTES:
     445
     446None.
     447
     448@subheading EXAMPLE:
     449
     450@example
     451@group
     452#include <rtems.h>
     453#include <assert.h>
     454
     455void task(rtems_task_argument arg);
     456
     457void example(void)
     458@{
     459  rtems_status_code sc;
     460  rtems_id          task_id;
     461  rtems_id          scheduler_id;
     462  rtems_name        scheduler_name;
     463
     464  scheduler_name = rtems_build_name('W', 'O', 'R', 'K');
     465
     466  sc = rtems_scheduler_ident(scheduler_name, &scheduler_id);
     467  assert(sc == RTEMS_SUCCESSFUL);
     468
     469  sc = rtems_task_create(
     470    rtems_build_name('T', 'A', 'S', 'K'),
     471    1,
     472    RTEMS_MINIMUM_STACK_SIZE,
     473    RTEMS_DEFAULT_MODES,
     474    RTEMS_DEFAULT_ATTRIBUTES,
     475    &task_id
     476  );
     477  assert(sc == RTEMS_SUCCESSFUL);
     478
     479  sc = rtems_task_set_scheduler(task_id, scheduler_id);
     480  assert(sc == RTEMS_SUCCESSFUL);
     481
     482  sc = rtems_task_start(task_id, task, 0);
     483  assert(sc == RTEMS_SUCCESSFUL);
     484@}
     485@end group
     486@end example
     487
     488@c
    412489@c rtems_task_get_affinity
    413490@c
Note: See TracChangeset for help on using the changeset viewer.