improve stability for Cache Manager and thumbnails and avoid race conditions.
preparation step 3 for making dcraw multithread safe.
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
class CacheManager;
|
||||
class Thumbnail {
|
||||
|
||||
Glib::Mutex* mutex;
|
||||
Glib::Mutex mutex;
|
||||
|
||||
Glib::ustring fname; // file name corresponding to the thumbnail
|
||||
CacheImageData cfs; // cache entry corresponding to the thumbnail
|
||||
@@ -61,9 +61,11 @@ class Thumbnail {
|
||||
// vector of listeners
|
||||
std::vector<ThumbnailListener*> listeners;
|
||||
|
||||
void _loadThumbnail (bool firstTrial=true);
|
||||
void _saveThumbnail ();
|
||||
void _generateThumbnailImage ();
|
||||
void infoFromImage (const Glib::ustring& fname, rtengine::RawMetaDataLocation* rml=NULL);
|
||||
void loadThumbnail (bool internal=false, bool firstTrial=true);
|
||||
void saveThumbnail ();
|
||||
void loadThumbnail (bool firstTrial=true);
|
||||
void generateExifDateTimeStrings ();
|
||||
|
||||
Glib::ustring getCacheFileName (Glib::ustring subdir);
|
||||
@@ -91,7 +93,7 @@ class Thumbnail {
|
||||
void getThumbnailSize (int &w, int &h);
|
||||
void getFinalSize (const rtengine::procparams::ProcParams& pparams, int& w, int& h) { if (tpp) tpp->getFinalSize (pparams, w, h); }
|
||||
|
||||
void generateThumbnailImage (bool internal=false);
|
||||
void generateThumbnailImage ();
|
||||
|
||||
const Glib::ustring& getExifString ();
|
||||
const Glib::ustring& getDateTimeString ();
|
||||
@@ -122,7 +124,7 @@ class Thumbnail {
|
||||
void decreaseRef ();
|
||||
|
||||
void updateCache ();
|
||||
void reSaveThumbnail () { mutex->lock (); saveThumbnail(); mutex->unlock(); }
|
||||
void saveThumbnail ();
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user