preview tooltip, ffv1 fmt, opengl overlay tweaks, clear nested render output bfr
[goodguy/history.git] / cinelerra-5.1 / guicast / mutex.h
index ab153add45b218170eb639e1391598bf71d47998..4a1052cdaf68221777bf54f99c61c622287a1e69 100644 (file)
@@ -53,13 +53,40 @@ public:
        const char *title;
 };
 
-class mLock
-{
-       Mutex &mutex;
+#if 0
+#include <stdio.h>
+
+class TMutex : public Mutex
+{ // logged
 public:
-       mLock(Mutex &m) : mutex(m) { mutex.lock(); }
-       mLock(Mutex *m) : mutex(*m) { mutex.lock(); }
-       ~mLock() { mutex.unlock(); }
+       TMutex(const char *title = 0, int recursive = 0)
+         : Mutex(title, recursive) {
+               printf("new TMutex(%s) = %p\n", title, this);
+       }
+       ~TMutex() {
+               printf("del TMutex(%s) = %p\n", title, this);
+       }
+       int lock(const char *location = 0) {
+               printf("locking %p: %s\n", this, title);  int ret = Mutex::lock(location);
+               printf("locked %p:%d %s\n", this, ret,  title);  return ret;
+       }
+       int unlock() {
+               printf("unlocking %p: %s\n", this, title);  return Mutex::unlock();
+       }
+       int trylock(const char *location = 0) {
+               printf("try locking %p: %s\n", this, title);  int ret = Mutex::trylock(location);
+               printf("try locked %p:%d %s\n", this, ret, title);  return ret;
+       }
+       int reset() {
+               printf("reset %p: %s\n", this, title);
+               return Mutex::reset();
+       }
+       int is_locked() {
+               int ret = Mutex::is_locked();
+               printf("is_locked %p:%d %s\n", this, ret, title);
+               return ret;
+       }
 };
 
 #endif
+#endif