posix: Fix fall back spinlock implementation

Update #2674.
This commit is contained in:
Sebastian Huber
2016-12-02 09:56:40 +01:00
parent e629076003
commit aadd318cd9
2 changed files with 7 additions and 10 deletions

View File

@@ -48,13 +48,13 @@ typedef struct {
} POSIX_Spinlock_Control;
#if !defined(POSIX_SPINLOCKS_ARE_SELF_CONTAINED)
#if defined(RTEMS_SMP)
extern POSIX_Spinlock_Control _POSIX_Spinlock_Global;
extern int _POSIX_Spinlock_Nest_level;
#if defined(RTEMS_SMP)
extern uint32_t _POSIX_Spinlock_Owner;
#endif
extern int _POSIX_Spinlock_Nest_level;
#endif
RTEMS_INLINE_ROUTINE POSIX_Spinlock_Control *_POSIX_Spinlock_Get(
@@ -63,12 +63,9 @@ RTEMS_INLINE_ROUTINE POSIX_Spinlock_Control *_POSIX_Spinlock_Get(
{
#if defined(POSIX_SPINLOCKS_ARE_SELF_CONTAINED)
return (POSIX_Spinlock_Control *) lock;
#elif defined(RTEMS_SMP)
(void) lock;
return &_POSIX_Spinlock_Global;
#else
(void) lock;
return NULL;
return &_POSIX_Spinlock_Global;
#endif
}

View File

@@ -54,13 +54,13 @@ RTEMS_STATIC_ASSERT(
POSIX_SPINLOCK_T_SIZE
);
#else
#if defined(RTEMS_SMP)
POSIX_Spinlock_Control _POSIX_Spinlock_Global;
int _POSIX_Spinlock_Nest_level;
#if defined(RTEMS_SMP)
uint32_t _POSIX_Spinlock_Owner = 0xffffffff;
#endif
int _POSIX_Spinlock_Nest_level;
#endif
int pthread_spin_lock( pthread_spinlock_t *spinlock )