thread_spinlock.h
上传用户:shtangtang
上传日期:2007-01-04
资源大小:167k
文件大小:0k
源码类别:
Linux/Unix编程
开发平台:
Unix_Linux
- #ifndef __THREADS_SPINLOCK_H
- #define __THREADS_SPINLOCK_H
- /**
- * A spinlock, is a primitive semaphore. With it we acquire
- * a unique lock, and release that lock.
- */
- struct spinlock {
- int s_spinlock;
- spinlock() { s_spinlock = 0; }
- int testandset();
- void acquire();
- void release();
- };
- #endif /* __THREADS_SPINLOCK_H */