From: Jeremy Lainé <jeremy.laine@m4x.org>
Subject: fix threading code

Without this patch, pdfshuffler immediately fails with the following error:

    Attempt to unlock mutex that was not locked
    Aborted

A similar issue was reported against reportbug:

    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=758619

--- a/pdfshuffler/pdfshuffler.py	2012-04-28 16:15:17.000000000 +0200
+++ b/pdfshuffler/pdfshuffler.py	2014-09-27 14:33:07.413122319 +0200
@@ -326,11 +326,9 @@
   
     def update_thumbnail(self, object, num, thumbnail, resample):
         row = self.model[num]
-        gtk.gdk.threads_enter()
         row[13] = resample
         row[4] = self.zoom_scale
         row[1] = thumbnail
-        gtk.gdk.threads_leave()
 
     def on_window_size_request(self, window, event):
         """Main Window resize - workaround for autosetting of
@@ -1080,9 +1078,10 @@
 def main():
     """This function starts PdfShuffler"""
     gtk.gdk.threads_init()
-    gobject.threads_init()
+    gtk.gdk.threads_enter()
     PdfShuffler()
     gtk.main()
+    gtk.gdk.threads_leave()
 
 if __name__ == '__main__':
     main()
