mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-12-12 11:33:02 +01:00
`GMemoryMonitor` is a singleton, which means we can’t use the usual approach of emitting signals in the thread-default main context from the time of construction of the object. The next best thing is to emit them in the global default main context. For many applications, this will be exactly what they are expecting. For multi-threaded applications, they will need to implement their own thread safety in the signal handler, but they would have to do that anyway. Currently, the signals are emitted in the GLib worker thread (for the PSI and poll implementations of `GMemoryMonitor`) — this is the worst option, because it means that third party signal handlers could block the worker thread (which is precisely what the worker thread is meant to avoid). Signed-off-by: Philip Withnall <pwithnall@gnome.org>
5.8 KiB
5.8 KiB