Bug 42036

Summary: glib-demo uses deprecated GLib threading API
Product: poppler Reporter: David King <amigadave>
Component: glib frontendAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: a9016009
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: conditionally initialise threads

Description David King 2011-10-20 02:40:04 UTC
Threading in GLib was changed significantly in version 2.31.0:

http://mail.gnome.org/archives/gtk-devel-list/2011-October/msg00056.html

The thread initialisation functions were deprecated, as threads are now unconditionally enabled. This causes poppler to not build inside jhbuild, using the latest GLib, due to g_thread_init() being called inside glib-demo:

make[4]: Entering directory `/home/david/checkout/gnome/poppler-0.18.0/glib/demo'
  CC     main.o
main.c: In function ‘pgd_demo_get_auth_dialog’:
main.c:183:2: warning: implicit declaration of function ‘gtk_dialog_set_has_separator’
main.c: In function ‘main’:
main.c:303:2: warning: implicit declaration of function ‘g_thread_supported’
main.c:304:3: warning: implicit declaration of function ‘g_thread_init’
  CXXLD  poppler-glib-demo
main.o: In function `main':
/home/david/checkout/gnome/poppler-0.18.0/glib/demo/main.c:303: undefined reference to `g_thread_supported'
collect2: ld returned 1 exit status
make[4]: *** [poppler-glib-demo] Error 1

Attaching a patch to fix this with a preprocessor check.
Comment 1 David King 2011-10-20 02:43:52 UTC
Created attachment 52574 [details] [review]
conditionally initialise threads
Comment 2 Andre Klapper 2011-11-09 09:44:40 UTC
ping - can this patch get in, please?
Comment 3 Carlos Garcia Campos 2011-11-10 03:55:09 UTC
We can actually get rid of g_thread_init since glib 2.24, see http://git.gnome.org/browse/glib/commit/?id=fa2bced1f30f93443ef43ce8b5b1e437cd07168c

I've just updated patch and pushed it to git master. 

Thanks!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.