> Well, I originally declared the structure globally because I needed to
> access it from a static method of the same class that spawns the
> thread, but I realised that that method didn't need to be static; so I
> changed that and made the structure a member of the class instead, and
> thus guarantee that it is allocated in memory before the thread is
> spawned, and it no longer violates. Since this is now the only
> CCriticalSection declared in the code, I believe I have got it right
> this time?

Yes, sounds like you have.

Anyway, I suggest you consider the approach I showed in my other post to
make sure the CS gets created upon its first usage, so that you wouldn't get
bitten by initialization order problems again in the future.

-------------
Ehsan Akhgari

Farda Technology (http://www.farda-tech.com/)

List Owner: [EMAIL PROTECTED]

[ Email: [EMAIL PROTECTED] ]
[ WWW: http://www.beginthread.com/Ehsan ]

Do ever what you will - but first be such as can will.
-Thus Spoke Zarathustra, F. W. Nietzsche





Reply via email to