Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
If this flag is set, then this policy will use a glib event loop
for every thread. Use this parameter if you want your loops to
interact with modules written in other languages.
default Use the default context (default: True)
Indicates whether you want to use the GLib default context. If set,
then the loop associated with the main thread will use the default
(NULL) GLib context (instead of creating a new one).
"""
self._full = full
self._default = default
self._default_loop = None
self._policy = unix_events.DefaultEventLoopPolicy()
self._policy.new_event_loop = self.new_event_loop
self.get_event_loop = self._policy.get_event_loop
self.set_event_loop = self._policy.set_event_loop
self.get_child_watcher = self._policy.get_child_watcher
self._policy.set_child_watcher(GLibChildWatcher())
BaseGLibEventLoop.init_class()
if threads:
logger.info("GLib threads enabled")
GObject.threads_init()
else:
logger.info("GLib threads not used")