mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-29 10:00:25 +08:00
19 lines
473 B
C
19 lines
473 B
C
|
#ifndef __PTHREAD_SPIN_H__
|
||
|
#define __PTHREAD_SPIN_H__
|
||
|
#include <pthread.h>
|
||
|
|
||
|
struct pthread_spinlock
|
||
|
{
|
||
|
int pshared;
|
||
|
};
|
||
|
typedef struct pthread_spinlock pthread_spinlock_t;
|
||
|
|
||
|
int pthread_spin_init (pthread_spinlock_t *lock, int pshared);
|
||
|
int pthread_spin_destroy (pthread_spinlock_t *lock);
|
||
|
|
||
|
int pthread_spin_lock (pthread_spinlock_t * lock);
|
||
|
int pthread_spin_trylock (pthread_spinlock_t * lock);
|
||
|
int pthread_spin_unlock (pthread_spinlock_t * lock);
|
||
|
|
||
|
#endif
|