
"Roland Schwarz" <roland.schwarz@chello.at> wrote in message news:4549A086.3050005@chello.at...
Chris Thomasson wrote:
Here is the C++ pseudo-code:
Please don't get me wrong. I very much appreciate your efforts, but since I am very short of time (I think I am not the only one), could you please also use some plain English words to describe your idea, so one can judge if it is worth spending the time studying your code.
I am very sorry here... I too am sometimes short of time, so I have to blast some pseudo-code out in order to get my point across, rather than doing a quick write-up... I promise you that once I get my atomic::once out of the pseudo-code stage, and transform it into a fully working prototype it will have documentation... ;^)
Also I did not see any response from you how your proposal deviates from previous similar ones with respect to:
Initialization order problem, i.e beeing able to be called from within global ctors.
I removed the ctor from atomic::once, but I need to think about that some more here...
Solving destruction of static objects (preferably at process shutdown).
I am using an augmented type of reference counting for this. It will dtor the static object only during/after the dtor for atomic::once runs and when the count drops to (-1). I used to wait until it dropped to zero in the version with the ctor because I was using it to init to 1.