18 #ifndef LIBCWD_PRIVATE_LOCK_INTERFACE_H
19 #define LIBCWD_PRIVATE_LOCK_INTERFACE_H
21 #if LIBCWD_THREAD_SAFE
25 class lock_interface_base_ct {
27 virtual int try_lock() = 0;
28 virtual void lock() = 0;
29 virtual void unlock() = 0;
30 virtual ~lock_interface_base_ct() { }
34 class lock_interface_tct :
public lock_interface_base_ct {
37 virtual int try_lock() {
return ptr->try_lock(); }
38 virtual void lock() { ptr->lock(); }
39 virtual void unlock() { ptr->unlock(); }
41 lock_interface_tct(T* mutex) : ptr(mutex) { }
44 class pthread_lock_interface_ct :
public lock_interface_base_ct {
47 virtual int try_lock();
49 virtual void unlock();
51 pthread_lock_interface_ct(pthread_mutex_t* mutex) : ptr(mutex) { }
namespace for libcwd.
Definition: debug.cc:87