Re: gthread once
- From: Sebastian Wilhelmi <wilhelmi ira uka de>
- To: Miroslaw Dobrzanski-Neumann <mne mosaic-ag com>
- Cc: GTKDEV <gtk-devel-list gnome org>
- Subject: Re: gthread once
- Date: 20 Feb 2002 09:58:10 +0100
Hi Miroslaw,
> What about the followin solution:
> let GOnce contain all information needed.
>
> GOnce contains all values needed as
>
> struct GThreadOnce
> {
> sig_atomic_t once;
> GThreadOnceFunction init_func;
> gpointer param;
> gpointer retval;
> }
>
> g_thread_once* () takes only one parameter, the once control block and returns
> the result of evaluation
I thought about that too, but writing those params into g_once makes the
code more readable.
Another problem, that I just noticed is, that we can't use GOnce for
g_static_mutex_get_mutex_impl, because that would we a chicken/egg
problem, but we can use the same technique and the same configure.in
tests.
Bye,
Sebastian
--
Sebastian Wilhelmi
mailto:wilhelmi ira uka de
http://goethe.ira.uka.de/~wilhelmi
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]