batch queue racing condition patch by steve.herrel 270
This commit is contained in:
@@ -29,9 +29,6 @@
|
||||
|
||||
#undef THREAD_PRIORITY_NORMAL
|
||||
|
||||
Glib::Thread *batchThread = NULL;
|
||||
Glib::Mutex* qMutex = NULL;
|
||||
|
||||
namespace rtengine {
|
||||
|
||||
IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* pl) {
|
||||
@@ -221,10 +218,6 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p
|
||||
|
||||
void batchProcessingThread (ProcessingJob* job, BatchProcessingListener* bpl) {
|
||||
|
||||
if (!qMutex)
|
||||
qMutex = new Glib::Mutex ();
|
||||
|
||||
qMutex->lock();
|
||||
ProcessingJob* currentJob = job;
|
||||
|
||||
while (currentJob) {
|
||||
@@ -234,21 +227,12 @@ void batchProcessingThread (ProcessingJob* job, BatchProcessingListener* bpl) {
|
||||
bpl->error ("Can not load input image.");
|
||||
currentJob = bpl->imageReady (img);
|
||||
}
|
||||
qMutex->unlock();
|
||||
}
|
||||
|
||||
void startBatchProcessing (ProcessingJob* job, BatchProcessingListener* bpl) {
|
||||
|
||||
|
||||
|
||||
if (bpl)
|
||||
batchThread = Glib::Thread::create(sigc::bind(sigc::ptr_fun(batchProcessingThread), job, bpl), 0, true, true, Glib::THREAD_PRIORITY_LOW);
|
||||
|
||||
if(qMutex)
|
||||
{
|
||||
delete qMutex;
|
||||
qMutex = NULL;
|
||||
}
|
||||
Glib::Thread::create(sigc::bind(sigc::ptr_fun(batchProcessingThread), job, bpl), 0, true, true, Glib::THREAD_PRIORITY_LOW);
|
||||
|
||||
}
|
||||
|
||||
|
@@ -78,7 +78,7 @@ BatchQueuePanel::BatchQueuePanel () {
|
||||
saveFormatPanel->init (options.saveFormat);
|
||||
outdirTemplate->set_text (options.savePathTemplate);
|
||||
if (Glib::file_test (options.savePathFolder, Glib::FILE_TEST_IS_DIR))
|
||||
outdirFolder->set_filename (options.savePathFolder);
|
||||
outdirFolder->set_current_folder (options.savePathFolder);
|
||||
useTemplate->set_active (options.saveUsePathTemplate);
|
||||
useFolder->set_active (!options.saveUsePathTemplate);
|
||||
|
||||
@@ -259,7 +259,7 @@ void BatchQueuePanel::saveOptions () {
|
||||
// since these settings are shared with editorpanel :
|
||||
void BatchQueuePanel::pathFolderChanged () {
|
||||
|
||||
options.savePathFolder = outdirFolder->get_filename();
|
||||
options.savePathFolder = outdirFolder->get_current_folder();
|
||||
}
|
||||
|
||||
void BatchQueuePanel::formatChanged (Glib::ustring f) {
|
||||
|
Reference in New Issue
Block a user