How do I guarantee a single GLib Application instance? -
i writing program works on both linux , windows , uses glib library. when program run user make sure there 1 instance of program allowed running. how can in platform agnostic manner not have race conditions?
i know gio has application class uses dbus handle this, uncertain if portable windows environment, or wine testing environment.
the gapplication class uses gdbus, reliably works on linux, *bsd, windows, , macos x.
on windows, first connection session bus using gdbus api result in new process spawning gdbusdaemon instance; address newly created session bus stored inside named mutex, , new processes requiring mutex able connect same session bus. way it's possible reuse same mechanism of acquiring name on session bus on platforms.
Comments
Post a Comment