mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
e2fd4e2bd0
Tue Dec 5 12:23:04 2000 Owen Taylor <otaylor@redhat.com> * gmain.[hc]: Major change in API for creating sources to handle multiple main loops (GMainContext *). GSources are now exposed as GSource * and implemented with structure derivation. * giochannel.[ch]: Changed vtable for GIOChannel to correspond to the new mainloop API, add g_io_channel_create_watch(). * gtypes.h: Move GTimeVal here. * gthread.h: Remove gmain.h include to avoid circularity. * giounix.c: Update for new GMain API. * giowin32.c: Update for new GMain API. (No check for proper compilation or working.) * timeloop.c timeloop-basic.c: A benchmarking program for the main loop comparing the main loop against a hand-written (timeloop-basic.c) variant. * tests/mainloop-test.c: New torture test of mainloop. * docs/Changes-2.0.txt: Started. Added text about changes to GMain. * gmain.c (g_main_add_poll_unlocked): Initial fd->revents to zero. (#8482, Benjamin Kahn)
24 lines
1016 B
Plaintext
24 lines
1016 B
Plaintext
* The event loop functionality GMain has extensively been revised to
|
|
support multiple separate main loops in separate threads. All sources
|
|
(timeouts, idle functions, etc.) are associated with a GMainContext.
|
|
|
|
Compatibility functions exist so that most application code dealing with
|
|
the main loop will continue to work. However, code that creates
|
|
new custom types of sources will require modification.
|
|
|
|
The main changes here are:
|
|
|
|
- Sources are now exposed as GSource *, rather than simply as numeric
|
|
IDS.
|
|
|
|
- New types of sources are created by structure "derivation" from GSource,
|
|
so the source_data parameter to the GSource vfuncs has been
|
|
replaced with a GSource *.
|
|
|
|
- Sources are first created, then later added to a specific GMainContext
|
|
|
|
- Dispatching has been modified so both the callback and data are passed
|
|
in to the ->dispatch() vfunc.
|
|
|
|
To go along with this change, the vtable for GIOChannel has changed and
|
|
add_watch() has been replaced by create_watch(). |