source: rtems/cpukit/score/src/threadyield.c @ fce900b5

5
Last change on this file since fce900b5 was bd12dda, checked in by Sebastian Huber <sebastian.huber@…>, on 05/11/16 at 09:54:49

score: Use thread state lock for current state

In addition protect scheduler of thread by thread state lock. Enables
use of scheduler per-instance locks.

Update #2555.

  • Property mode set to 100644
File size: 825 bytes
Line 
1/**
2 * @file
3 *
4 * @brief Thread Yield
5 *
6 * @ingroup ScoreThread
7 */
8
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#if HAVE_CONFIG_H
24  #include "config.h"
25#endif
26
27#include <rtems/score/threadimpl.h>
28#include <rtems/score/schedulerimpl.h>
29
30void _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}
Note: See TracBrowser for help on using the repository browser.