source: rtems/cpukit/posix/src/pspinunlock.c @ 1d572eba

5
Last change on this file since 1d572eba was 4a03e752, checked in by Sebastian Huber <sebastian.huber@…>, on 01/13/17 at 08:45:59

configure: Remove SIZEOF_PTHREAD_SPINLOCK_T

  • Property mode set to 100644
File size: 911 bytes
Line 
1/**
2 * @file
3 *
4 * @brief Function Unlocks a Spin Lock Object
5 * @ingroup POSIXAPI
6 */
7
8/*
9 *  POSIX Spinlock Manager -- Wait at a Spinlock
10 *
11 *  COPYRIGHT (c) 1989-2007.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  Copyright (c) 2016 embedded brains GmbH
15 *
16 *  The license and distribution terms for this file may be
17 *  found in the file LICENSE in this distribution or at
18 *  http://www.rtems.org/license/LICENSE.
19 */
20
21#if HAVE_CONFIG_H
22#include "config.h"
23#endif
24
25#include <rtems/posix/spinlockimpl.h>
26
27int pthread_spin_unlock( pthread_spinlock_t *lock )
28{
29  POSIX_Spinlock_Control *the_spinlock;
30  ISR_Level               level;
31
32  the_spinlock = _POSIX_Spinlock_Get( lock );
33  level = the_spinlock->interrupt_state;
34#if defined(RTEMS_SMP)
35  _SMP_ticket_lock_Release(
36    &the_spinlock->Lock,
37    &_Per_CPU_Get()->Lock_stats_context
38  );
39#endif
40  _ISR_Local_enable( level );
41  return 0;
42}
Note: See TracBrowser for help on using the repository browser.