source: rtems/cpukit/score/src/schedulercbsdetachthread.c @ 2d7ae960

4.115
Last change on this file since 2d7ae960 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*
2 *  Copyright (C) 2011 Petr Benes.
3 *  Copyright (C) 2011 On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 */
9
10#if HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#include <rtems/system.h>
15#include <rtems/config.h>
16#include <rtems/score/scheduler.h>
17#include <rtems/score/schedulercbs.h>
18
19int _Scheduler_CBS_Detach_thread (
20  Scheduler_CBS_Server_id server_id,
21  rtems_id                task_id
22)
23{
24  Objects_Locations location;
25  Thread_Control *the_thread;
26  Scheduler_CBS_Per_thread *sched_info;
27
28  the_thread = _Thread_Get(task_id, &location);
29  /* The routine _Thread_Get may disable dispatch and not enable again. */
30  if ( the_thread ) {
31    _Thread_Enable_dispatch();
32  }
33
34  if ( server_id >= _Scheduler_CBS_Maximum_servers )
35    return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
36  if ( !the_thread )
37    return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
38  /* Server is not valid. */
39  if ( !_Scheduler_CBS_Server_list[server_id] )
40    return SCHEDULER_CBS_ERROR_NOSERVER;
41  /* Thread and server are not attached. */
42  if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id )
43    return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
44
45  _Scheduler_CBS_Server_list[server_id]->task_id = -1;
46  sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info;
47  sched_info->cbs_server = NULL;
48
49  the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
50  the_thread->budget_callout   = the_thread->Start.budget_callout;
51  the_thread->is_preemptible   = the_thread->Start.is_preemptible;
52
53  return SCHEDULER_CBS_OK;
54}
Note: See TracBrowser for help on using the repository browser.