pthread/spinlock: move the structure prototype out of the definition
pthread/pthread_spinlock.c: In function ‘pthread_spin_init’:
pthread/pthread_spinlock.c:114:11: error: dereferencing pointer to incomplete type ‘pthread_spinlock_t’ {aka ‘struct pthread_spinlock_s’}
114 | lock->sp_lock = SP_UNLOCKED;
| ^~
Change-Id: I49dbb2682e36a17bb25a647c6468b7fb511e4a76
Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
parent
616b3e7436
commit
8b42e6abd2
1 changed files with 1 additions and 2 deletions
|
|
@ -416,7 +416,6 @@ typedef int pthread_rwlockattr_t;
|
||||||
0, 0, false}
|
0, 0, false}
|
||||||
|
|
||||||
#ifdef CONFIG_PTHREAD_SPINLOCKS
|
#ifdef CONFIG_PTHREAD_SPINLOCKS
|
||||||
#ifndef __PTHREAD_SPINLOCK_T_DEFINED
|
|
||||||
/* This (non-standard) structure represents a pthread spinlock */
|
/* This (non-standard) structure represents a pthread spinlock */
|
||||||
|
|
||||||
struct pthread_spinlock_s
|
struct pthread_spinlock_s
|
||||||
|
|
@ -426,7 +425,7 @@ struct pthread_spinlock_s
|
||||||
* SP_UNLOCKED. */
|
* SP_UNLOCKED. */
|
||||||
pthread_t sp_holder; /* ID of the thread that holds the spinlock */
|
pthread_t sp_holder; /* ID of the thread that holds the spinlock */
|
||||||
};
|
};
|
||||||
|
#ifndef __PTHREAD_SPINLOCK_T_DEFINED
|
||||||
/* It is referenced via this standard type */
|
/* It is referenced via this standard type */
|
||||||
|
|
||||||
typedef FAR struct pthread_spinlock_s pthread_spinlock_t;
|
typedef FAR struct pthread_spinlock_s pthread_spinlock_t;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue