Re: bugs regarding late g_thread_init() calls
- From: "Morten Welinder" <mortenw gnome org>
- To: gtk-devel-list gnome org
- Subject: Re: bugs regarding late g_thread_init() calls
- Date: Tue, 2 Jan 2007 20:38:37 -0500
This leaves the question as to what macros it is safe to use before calling
g_thread_init.
I can look up the current definition of MIN and see, that yes it does
not involve
a function call, but that could change without notice in the next point release.
I guess that macros that are advertised to be constant in the sense that they
can be used at the preprocessor level are safe. But all in all, this situation
is a bit of a mess.
M.
And in case you wonder. I need to run this code before threads get initialized:
#ifdef HAVE_SYS_RESOURCE_H
struct rlimit rlim;
if (getrlimit (RLIMIT_STACK, &rlim) == 0) {
rlim_t our_lim = 64 * 1024 * 1024;
if (rlim.rlim_max != RLIM_INFINITY)
our_lim = MIN (our_lim, rlim.rlim_max);
if (rlim.rlim_cur != RLIM_INFINITY &&
rlim.rlim_cur < our_lim) {
rlim.rlim_cur = our_lim;
(void)setrlimit (RLIMIT_STACK, &rlim);
}
}
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]