glib/gmodule
Christoph Reiter 6a903ff6d7 Fix g_module_symbol() under Windows sometimes not succeeding
g_module_symbol() internally calls CreateToolhelp32Snapshot() which
in some circumstances returns ERROR_BAD_LENGTH and according to the docs
should lead to CreateToolhelp32Snapshot() being retried by the caller.

This retry logic was missing and for example led to g_module_symbol()
not succeeding if another thread happened to call the wrong function
at the wrong time.

This got noticed in the g-i build of gtk4 where g-i would call g_module_symbol()
on all gtk4 _get_type symbols and while inspecting the properties gtk4 would
spawn a thread calling SHGetSpecialFolderLocation() somewhere down the line.
During the call to SHGetSpecialFolderLocation() CreateToolhelp32Snapshot() would
return with ERROR_BAD_LENGTH for a short period of time and make g_module_symbol()
fail, which lead to "Invalid GType function" errors in g-i.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3213
2020-09-30 09:57:40 +02:00
..
AUTHORS initial import of gmodule. 1998-08-09 08:32:18 +00:00
COPYING gmodule/: LGPLv2+ -> LGPLv2.1+ 2017-05-24 11:58:19 +02:00
gmodule-ar.c gmodule: change _g_module_close to only take a handle. 2019-12-12 16:15:05 +00:00
gmodule-dl.c tree: Fix various typos and outdated terminology 2020-06-12 15:01:08 +01:00
gmodule-win32.c Fix g_module_symbol() under Windows sometimes not succeeding 2020-09-30 09:57:40 +02:00
gmodule.c tree: Fix various typos and outdated terminology 2020-06-12 15:01:08 +01:00
gmodule.h tree: Fix various typos and outdated terminology 2020-06-12 15:01:08 +01:00
gmodule.rc.in meson: build Windows resource files 2018-01-04 22:19:30 +01:00
gmoduleconf.h.in gmodule: remove macOS dyld implementation 2019-09-07 16:41:34 +01:00
meson.build Meson: Override every dependency glib provides 2020-04-05 00:34:04 -04:00