change: change code style to Linux style except indent.
This commit is contained in:
@@ -20,43 +20,44 @@
|
||||
|
||||
#include "customcachetask.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
CustomCacheTask::CustomCacheTask(const QString &sequence_name) :
|
||||
cancelled_through_finish_(false)
|
||||
namespace olive
|
||||
{
|
||||
SetTitle(tr("Caching custom range for \"%1\"").arg(sequence_name));
|
||||
|
||||
CustomCacheTask::CustomCacheTask(const QString &sequence_name)
|
||||
: cancelled_through_finish_(false)
|
||||
{
|
||||
SetTitle(tr("Caching custom range for \"%1\"").arg(sequence_name));
|
||||
}
|
||||
|
||||
void CustomCacheTask::Finish()
|
||||
{
|
||||
mutex_.lock();
|
||||
mutex_.lock();
|
||||
|
||||
cancelled_through_finish_ = true;
|
||||
Cancel();
|
||||
cancelled_through_finish_ = true;
|
||||
Cancel();
|
||||
|
||||
mutex_.unlock();
|
||||
mutex_.unlock();
|
||||
}
|
||||
|
||||
bool CustomCacheTask::Run()
|
||||
{
|
||||
mutex_.lock();
|
||||
mutex_.lock();
|
||||
|
||||
while (!IsCancelled()) {
|
||||
wait_cond_.wait(&mutex_);
|
||||
}
|
||||
while (!IsCancelled()) {
|
||||
wait_cond_.wait(&mutex_);
|
||||
}
|
||||
|
||||
mutex_.unlock();
|
||||
mutex_.unlock();
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CustomCacheTask::CancelEvent()
|
||||
{
|
||||
if (!cancelled_through_finish_) {
|
||||
emit Cancelled();
|
||||
}
|
||||
wait_cond_.wakeOne();
|
||||
if (!cancelled_through_finish_) {
|
||||
emit Cancelled();
|
||||
}
|
||||
wait_cond_.wakeOne();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user