5
Last change
on this file since 127c20eb was
75aef54,
checked in by Sebastian Huber <sebastian.huber@…>, on 03/17/16 at 05:16:23
|
posix: Avoid Giant lock in sched_yield()
Update #2555.
|
-
Property mode set to
100644
|
File size:
702 bytes
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Yield Processor |
---|
5 | * @ingroup POSIXAPI |
---|
6 | */ |
---|
7 | |
---|
8 | /* |
---|
9 | * COPYRIGHT (c) 1989-2007. |
---|
10 | * On-Line Applications Research Corporation (OAR). |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.org/license/LICENSE. |
---|
15 | */ |
---|
16 | |
---|
17 | #if HAVE_CONFIG_H |
---|
18 | #include "config.h" |
---|
19 | #endif |
---|
20 | |
---|
21 | #include <sched.h> |
---|
22 | |
---|
23 | #include <rtems/score/percpu.h> |
---|
24 | #include <rtems/score/threaddispatch.h> |
---|
25 | #include <rtems/score/threadimpl.h> |
---|
26 | |
---|
27 | int sched_yield( void ) |
---|
28 | { |
---|
29 | Per_CPU_Control *cpu_self; |
---|
30 | |
---|
31 | cpu_self = _Thread_Dispatch_disable(); |
---|
32 | _Thread_Yield( _Per_CPU_Get_executing( cpu_self ) ); |
---|
33 | _Thread_Dispatch_enable( cpu_self ); |
---|
34 | return 0; |
---|
35 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.