glib: use task_tls-based global struct for per-task GPrivate on NuttX
On NuttX, static GPrivate variables are shared across tasks, breaking task isolation. Aggregate default_main_context, depth_private and thread_specific_private into a glib_global_t struct backed by a single task_tls slot (following libuv’s uv__global_t pattern).
- gthreadprivate.h: add glib_global_t definition and glib_global_get()
- gmain.c: implement glib_global_get(), use #define macro substitution for default_main_context and depth_private
- gthread.c: #define g_thread_specific_private to global struct member, guard unused g_thread_cleanup with #ifndef NuttX
Signed-off-by: wangchen wangchen41@xiaomi.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
GLib
GLib is the low-level core library that forms the basis for projects such as GTK and GNOME. It provides data structure handling for C, portability wrappers, and interfaces for such runtime functionality as an event loop, threads, dynamic loading, and an object system.
The official download locations are: https://download.gnome.org/sources/glib
The official web site is: https://www.gtk.org/
Installation
See the file ‘INSTALL.md‘
Supported versions
Only the most recent unstable and stable release series are supported. All older versions are not supported upstream and may contain bugs, some of which may be exploitable security vulnerabilities.
See SECURITY.md for more details.
Documentation
API documentation is available online for GLib for the:
Discussion
If you have a question about how to use GLib, seek help on GNOME’s Discourse instance. Alternatively, ask a question on StackOverflow and tag it
glib.Reporting bugs
Bugs should be reported to the GNOME issue tracking system. You will need to create an account for yourself. You may also submit bugs by e-mail (without an account) by e-mailing incoming+gnome-glib-658-issue-@gitlab.gnome.org, but this will give you a degraded experience.
Bugs are for reporting problems in GLib itself, not for asking questions about how to use it. To ask questions, use one of our discussion forums.
In bug reports please include:
tests/subdirectory, that will be most convenient. Otherwise, please include a short test program that exhibits the behavior. As a last resort, you can also provide a pointer to a larger piece of software that can be downloaded.Contributing to GLib
Please follow the contribution guide to know how to start contributing to GLib.
Patches should be submitted as merge requests to gitlab.gnome.org. If the patch fixes an existing issue, please refer to the issue in your commit message with the following notation (for issue 123):
Otherwise, create a new merge request that introduces the change. Filing a separate issue is not required.
Default branch renamed to
mainThe default development branch of GLib has been renamed to
main. To update your local checkout, use: