RTEMS
cpukit
score
src
threadyield.c
Go to the documentation of this file.
1
9
/*
10
* Copyright (c) 2014 embedded brains GmbH. All rights reserved.
11
*
12
* embedded brains GmbH
13
* Dornierstr. 4
14
* 82178 Puchheim
15
* Germany
16
* <rtems@embedded-brains.de>
17
*
18
* The license and distribution terms for this file may be
19
* found in the file LICENSE in this distribution or at
20
* http://www.rtems.org/license/LICENSE.
21
*/
22
23
#ifdef HAVE_CONFIG_H
24
#include "config.h"
25
#endif
26
27
#include <
rtems/score/threadimpl.h
>
28
#include <
rtems/score/schedulerimpl.h
>
29
30
void
_Thread_Yield
(
Thread_Control
*executing )
31
{
32
ISR_lock_Context
lock_context;
33
34
_Thread_State_acquire
( executing, &lock_context );
35
36
if
(
_States_Is_ready
( executing->
current_state
) ) {
37
_Scheduler_Yield
( executing );
38
}
39
40
_Thread_State_release
( executing, &lock_context );
41
}
_Thread_Yield
void _Thread_Yield(Thread_Control *executing)
Yields the currently executing thread.
Definition:
threadyield.c:30
schedulerimpl.h
Inlined Routines Associated with the Manipulation of the Scheduler.
_Thread_State_release
static __inline__ void _Thread_State_release(Thread_Control *the_thread, ISR_lock_Context *lock_context)
Releases the lock context and enables interrupts.
Definition:
threadimpl.h:592
_Thread_Control
Definition:
thread.h:725
_Thread_Control::current_state
States_Control current_state
Definition:
thread.h:749
_States_Is_ready
static __inline__ bool _States_Is_ready(States_Control the_states)
Checks if the state is ready.
Definition:
statesimpl.h:195
_Scheduler_Yield
static __inline__ void _Scheduler_Yield(Thread_Control *the_thread)
Scheduler yield with a particular thread.
Definition:
schedulerimpl.h:245
threadimpl.h
Inlined Routines from the Thread Handler.
ISR_lock_Context
Local ISR lock context for acquire and release pairs.
Definition:
isrlock.h:65
_Thread_State_acquire
static __inline__ void _Thread_State_acquire(Thread_Control *the_thread, ISR_lock_Context *lock_context)
Disables interrupts and acquires the lock_context.
Definition:
threadimpl.h:542
Generated by
1.8.14