projects
/
goodguy
/
cinelerra.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
upgrade to ffmpeg 4.2, rework mask for speedup
[goodguy/cinelerra.git]
/
cinelerra-5.1
/
guicast
/
condition.C
diff --git
a/cinelerra-5.1/guicast/condition.C
b/cinelerra-5.1/guicast/condition.C
index e57110cab9bb76a15299c195bceef055dca32d3e..89cbe692e6fade3cfb4a282e3170cf40838225cd 100644
(file)
--- a/
cinelerra-5.1/guicast/condition.C
+++ b/
cinelerra-5.1/guicast/condition.C
@@
-52,6
+52,7
@@
void Condition::reset()
pthread_mutex_init(&mutex, 0);
pthread_cond_init(&cond, NULL);
UNSET_ALL_LOCKS(this);
pthread_mutex_init(&mutex, 0);
pthread_cond_init(&cond, NULL);
UNSET_ALL_LOCKS(this);
+ unset_owner();
value = init_value;
trace = 0;
}
value = init_value;
trace = 0;
}
@@
-66,6
+67,8
@@
void Condition::lock(const char *location)
value = 0;
else
value--;
value = 0;
else
value--;
+ if( !value )
+ set_owner();
pthread_mutex_unlock(&mutex);
}
pthread_mutex_unlock(&mutex);
}
@@
-78,6
+81,7
@@
void Condition::unlock()
value = 1;
else
value++;
value = 1;
else
value++;
+ unset_owner();
pthread_cond_signal(&cond);
pthread_mutex_unlock(&mutex);
}
pthread_cond_signal(&cond);
pthread_mutex_unlock(&mutex);
}
@@
-130,6
+134,8
@@
int Condition::timed_lock(int microseconds, const char *location)
else
--value;
}
else
--value;
}
+ if( !value )
+ set_owner();
pthread_mutex_unlock(&mutex);
return result;
}
pthread_mutex_unlock(&mutex);
return result;
}