[poppler] [PATCH] Allow to build without multithreading

Peter Breitenlohner peb at mppmu.mpg.de
Tue Jun 4 06:31:05 PDT 2013


Signed-off-by: Peter Breitenlohner <peb at mppmu.mpg.de>
---
 poppler/Annot.cc | 6 ++++++
 poppler/XRef.cc  | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 2713fde..7e2f273 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -1543,13 +1543,19 @@ void Annot::incRefCnt() {
 }
 
 void Annot::decRefCnt() {
+#if MULTITHREADED
   gLockMutex(&mutex);
+#endif
   if (--refCnt == 0) {
+#if MULTITHREADED
     gUnlockMutex(&mutex);
+#endif
     delete this;
     return;
   }
+#if MULTITHREADED
   gUnlockMutex(&mutex);
+#endif
 }
 
 Annot::~Annot() {
diff --git a/poppler/XRef.cc b/poppler/XRef.cc
index 85f8a6f..5495b62 100644
--- a/poppler/XRef.cc
+++ b/poppler/XRef.cc
@@ -1252,11 +1252,15 @@ Object *XRef::fetch(int num, int gen, Object *obj, int recursion) {
 }
 
 void XRef::lock() {
+#if MULTITHREADED
   gLockMutex(&mutex);
+#endif
 }
 
 void XRef::unlock() {
+#if MULTITHREADED
   gUnlockMutex(&mutex);
+#endif
 }
 
 Object *XRef::getDocInfo(Object *obj) {
-- 
1.8.2.2



More information about the poppler mailing list