g_error() in g_private_new_win32_impl



hi hans and tor.

gthread/gthread-win32.c:g_private_new_win32_impl() contains a call to g_error(). however, g_error needs the messaging system to be readily
setup already, which isn't the case upon the first private_new() calls.

the various initialization stages are documented now in
glib/gthread.c:g_thread_init_glib().

i'd recommend to move to some other error mechanism (stderr printf +
abort(), etc.) for the scope of this function. also, i think the private-max setting is rather small:
gthread/gthread-win32.c:#define G_PRIVATE_MAX 16
since for some cases, even third-party glib-using code needs to use
g_private_new() instead of GStaticPrivate, it might be better to raise
this number somewhat (say to 32 or 64).
for what it's worth, glibc allowes around 1024 keys to be created
with pthread_key_create().

---
ciaoTJ



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]