?? cps_mutex.h
字號:
// class for mutual exclusion using the CPS-library of the CONVEX#include <cps.h>#include <errno.h>class leda_mutex { leda_mutex(const leda_mutex& m) { cps_mutex_alloc(&lock_);} leda_mutex operator=(const leda_mutex& m) { cps_mutex_alloc(&lock_); return *this; }public: leda_mutex() { cps_mutex_alloc (&lock_); } ~leda_mutex() { cps_mutex_free (&lock_); } void acquire() { cps_mutex_lock (&lock_); } void lock() { cps_mutex_lock (&lock_); } void enter() { cps_mutex_lock (&lock_); } void release() { cps_mutex_unlock (&lock_); } void unlock() { cps_mutex_unlock (&lock_); } void exit() { cps_mutex_unlock (&lock_); } int trylock() { return cps_mutex_trylock (&lock_); } int tryenter() { return cps_mutex_trylock (&lock_); } private: cps_mutex_t lock_;};
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -