forked from joejulian/gio
1796f24a38
Window.driverRun is designed to run functions on the driver event goroutine, to avoid race conditions with internal driver state and, more importantly, to run on the designated main or UI thread for platforms that require that. However, driverRun runs functions during the processing of a driver event, so if a function in turn triggers another driver event, deadlock occurs. This change introduces Window.driverDefer for functions that don't need to block event processing. Functions passed to driverDefer may themselves trigger new events. A few callers of driverRun remain; they need the result of their functions but are guaranteed not to trigger new events. Fixes gio#263 Signed-off-by: Elias Naur <mail@eliasnaur.com>