[poppler] [PATCH] Allow to build without multithreading

Albert Astals Cid aacid at kde.org
Mon Jun 3 10:58:10 PDT 2013


El Dilluns, 3 de juny de 2013, a les 13:37:52, Peter Breitenlohner va 
escriure:
> Hi,

Hi

> 
> for poppler <= 0.22 it was possible to build libpoppler without
> multithreading, but this fails for 0.23.
> 
> I know that configure.ac always defines MULTITHREADED and a shared
> libpoppler should certainly not be built without it.  For special
> situations, e.g., for TeX Live where libpoppler is only used by
> luatex/pdftex/xetex to parse pdf files to be included as images, it does
> make sense to build a non-shared library without multithreading.

I'll accept this patch for now, but take into account that someday we will 
remove this MULTITHREADED since it adds no value to us, and we've already said 
many times that we don't want people directly using the poppler/ includes.

BTW your patch again fails to apply here, or maybe it's me, a simple "git am" 
when saving this mail should do, right?

Cheers,
  Albert

> 
> In 0.23.1 there are a few new uses of mutex, not surrounded by
>    #if MULTITHREADED ... #endif
> the patch below provides these guards:
> 
> From 74f4666083090f4ddb98d4a47de2719fb241790f Mon Sep 17 00:00:00 2001
> From: Peter Breitenlohner <peb at mppmu.mpg.de>
> Date: Mon, 3 Jun 2013 13:11:01 +0200
> Subject: [PATCH] Allow to build without multithreading
> To: Albert Astals Cid <aacid at kemper.freedesktop.org>
> Cc: poppler at lists.freedesktop.org
> 
> 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) {


More information about the poppler mailing list