Mercurial > hg > orthanc
changeset 4458:e4dae17035b9
fix ParsedDicomCache for emscripten
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 20 Jan 2021 12:43:44 +0100 |
parents | 789676a8c96a |
children | 16392fe89ce0 |
files | OrthancFramework/Sources/DicomParsing/ParsedDicomCache.cpp OrthancFramework/Sources/DicomParsing/ParsedDicomCache.h OrthancServer/Sources/main.cpp |
diffstat | 3 files changed, 17 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomParsing/ParsedDicomCache.cpp Tue Jan 19 19:05:04 2021 +0100 +++ b/OrthancFramework/Sources/DicomParsing/ParsedDicomCache.cpp Wed Jan 20 12:43:44 2021 +0100 @@ -71,7 +71,9 @@ size_t ParsedDicomCache::GetNumberOfItems() { +#if !defined(__EMSCRIPTEN__) boost::mutex::scoped_lock lock(mutex_); +#endif if (cache_.get() == NULL) { @@ -88,7 +90,9 @@ size_t ParsedDicomCache::GetCurrentSize() { +#if !defined(__EMSCRIPTEN__) boost::mutex::scoped_lock lock(mutex_); +#endif if (cache_.get() == NULL) { @@ -105,7 +109,9 @@ void ParsedDicomCache::Invalidate(const std::string& id) { +#if !defined(__EMSCRIPTEN__) boost::mutex::scoped_lock lock(mutex_); +#endif if (cache_.get() != NULL) { @@ -124,7 +130,9 @@ ParsedDicomFile* dicom, // Takes ownership size_t fileSize) { +#if !defined(__EMSCRIPTEN__) boost::mutex::scoped_lock lock(mutex_); +#endif if (fileSize >= cacheSize_) { @@ -151,7 +159,9 @@ ParsedDicomCache::Accessor::Accessor(ParsedDicomCache& that, const std::string& id) : +#if !defined(__EMSCRIPTEN__) lock_(that.mutex_), +#endif id_(id), file_(NULL), fileSize_(0)
--- a/OrthancFramework/Sources/DicomParsing/ParsedDicomCache.h Tue Jan 19 19:05:04 2021 +0100 +++ b/OrthancFramework/Sources/DicomParsing/ParsedDicomCache.h Wed Jan 20 12:43:44 2021 +0100 @@ -32,7 +32,10 @@ private: class Item; +#if !defined(__EMSCRIPTEN__) boost::mutex mutex_; +#endif + size_t cacheSize_; std::unique_ptr<MemoryObjectCache> cache_; std::unique_ptr<ParsedDicomFile> largeDicom_; @@ -55,7 +58,10 @@ class Accessor : public boost::noncopyable { private: +#if !defined(__EMSCRIPTEN__) boost::mutex::scoped_lock lock_; +#endif + std::string id_; ParsedDicomFile* file_; size_t fileSize_;
--- a/OrthancServer/Sources/main.cpp Tue Jan 19 19:05:04 2021 +0100 +++ b/OrthancServer/Sources/main.cpp Wed Jan 20 12:43:44 2021 +0100 @@ -647,7 +647,7 @@ << "Options are read left to right. In particular, options such as \"--verbose\" can " << std::endl << "reset the value of other log-related options that were read before." << std::endl << std::endl - << "The recommended set of options to debug DICOM communications is " + << "The recommended set of options to debug DICOM communications is " << std::endl << "\"--verbose --trace-dicom --logfile=dicom.log\"" << std::endl << std::endl << "Command-line options:" << std::endl