projects
/
goodguy
/
cinelerra.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dragcheckbox rework, boxblur create can grab
[goodguy/cinelerra.git]
/
cinelerra-5.1
/
guicast
/
mutex.C
diff --git
a/cinelerra-5.1/guicast/mutex.C
b/cinelerra-5.1/guicast/mutex.C
index 6ac188d5e2c7222f1d3af68c02430ff2c6cfeba1..9acbfc9f70aea726bee4dd2f298a59d6a33addd7 100644
(file)
--- a/
cinelerra-5.1/guicast/mutex.C
+++ b/
cinelerra-5.1/guicast/mutex.C
@@
-30,7
+30,6
@@
Mutex::Mutex(const char *title, int recursive)
{
this->title = title;
Mutex::Mutex(const char *title, int recursive)
{
this->title = title;
- this->trace = 0;
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
pthread_mutex_init(&mutex, &attr);
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
pthread_mutex_init(&mutex, &attr);
@@
-66,7
+65,7
@@
int Mutex::lock(const char *location)
SET_LOCK(this, title, location);
if(pthread_mutex_lock(&mutex)) perror("Mutex::lock");
SET_LOCK(this, title, location);
if(pthread_mutex_lock(&mutex)) perror("Mutex::lock");
-
+ set_owner();
// Update recursive status for the first lock
// Update recursive status for the first lock
@@
-92,6
+91,7
@@
int Mutex::unlock()
{
if( count <= 0 ) {
printf("Mutex::unlock not locked: %s\n", title);
{
if( count <= 0 ) {
printf("Mutex::unlock not locked: %s\n", title);
+ booby();
return 0;
}
// Remove from recursive status
return 0;
}
// Remove from recursive status
@@
-115,6
+115,7
@@
int Mutex::unlock()
UNSET_LOCK(this);
UNSET_LOCK(this);
+ unset_owner();
int ret = pthread_mutex_unlock(&mutex);
if( ret ) fprintf(stderr, "Mutex::unlock: %s\n",strerror(ret));
int ret = pthread_mutex_unlock(&mutex);
if( ret ) fprintf(stderr, "Mutex::unlock: %s\n",strerror(ret));
@@
-126,6
+127,7
@@
int Mutex::trylock(const char *location)
if( count ) return EBUSY;
int ret = pthread_mutex_trylock(&mutex);
if( ret ) return ret;
if( count ) return EBUSY;
int ret = pthread_mutex_trylock(&mutex);
if( ret ) return ret;
+ set_owner();
// Update recursive status for the first lock
if(recursive) {
// Update recursive status for the first lock
if(recursive) {
@@
-155,6
+157,7
@@
int Mutex::reset()
pthread_mutexattr_init(&attr);
pthread_mutex_init(&mutex, &attr);
UNSET_ALL_LOCKS(this)
pthread_mutexattr_init(&attr);
pthread_mutex_init(&mutex, &attr);
UNSET_ALL_LOCKS(this)
+ unset_owner();
trace = 0;
count = 0;
thread_id = 0;
trace = 0;
count = 0;
thread_id = 0;