RTEMS
pspininit.c
Go to the documentation of this file.
1 
9 /*
10  * POSIX Spinlock Manager -- Initialize a Spinlock Instance
11  *
12  * COPYRIGHT (c) 1989-2006.
13  * On-Line Applications Research Corporation (OAR).
14  *
15  * Copyright (c) 2016 embedded brains GmbH
16  *
17  * The license and distribution terms for this file may be
18  * found in the file LICENSE in this distribution or at
19  * http://www.rtems.org/license/LICENSE.
20  */
21 
22 #ifdef HAVE_CONFIG_H
23 #include "config.h"
24 #endif
25 
27 
28 int pthread_spin_init(
29  pthread_spinlock_t *spinlock,
30  int pshared
31 )
32 {
33 #if defined(RTEMS_SMP)
34  POSIX_Spinlock_Control *the_spinlock;
35 
36  the_spinlock = _POSIX_Spinlock_Get( spinlock );
37  _SMP_ticket_lock_Initialize( &the_spinlock->Lock );
38 #endif
39  return 0;
40 }
Inlined Routines from the POSIX Spinlock Manager.
static void _SMP_ticket_lock_Initialize(SMP_ticket_lock_Control *lock)
Initializes the SMP ticket lock.
Definition: smplockticket.h:61