pthread_spin.h 529 B

12345678910111213141516171819
  1. #ifndef __PTHREAD_SPIN_H__
  2. #define __PTHREAD_SPIN_H__
  3. #include <pthread.h>
  4. /* spinlock implementation, (ADVANCED REALTIME THREADS)*/
  5. struct pthread_spinlock
  6. {
  7. int lock;
  8. };
  9. typedef struct pthread_spinlock pthread_spinlock_t;
  10. int pthread_spin_init (pthread_spinlock_t *lock, int pshared);
  11. int pthread_spin_destroy (pthread_spinlock_t *lock);
  12. int pthread_spin_lock (pthread_spinlock_t * lock);
  13. int pthread_spin_trylock (pthread_spinlock_t * lock);
  14. int pthread_spin_unlock (pthread_spinlock_t * lock);
  15. #endif