[omniORB] Omni_mutex and static global object

Frederic Prin frederic.prin at silvaco.com
Wed Sep 15 15:55:38 BST 2004


Thanks for your answer!
 
>... wouldn't expect omniORB to be setup yet since you haven't even
called orb_init(). 
Yes you are right. But it is orb_init() itself that crash (when
internaly invoke omni_mutex) !
 
Thanks for your suggestion. This was the only idea I got but the idea to
add a call into EVERY methods call was just frightening me and I was
looking for another one.
 
Fred

-----Original Message-----
From: ssredige at rockwellcollins.com [mailto:ssredige at rockwellcollins.com]

Sent: mercredi 15 septembre 2004 14:42
To: frederic.prin at silvaco.com
Cc: omniorb-list at omniorb-support.com
Subject: Re: [omniORB] Omni_mutex and static global object



>> I ran into errors when making some omniORB API calls from
constructors of my global static objects (on windows). 

If you have a global static object, it is instanciated before main()
enters. Therefore, I wouldn't expect omniORB to be setup yet since you
haven't even called orb_init(). 


>> If the last point is the good one, is someone knows another  way to
instanciate my singleton class without an explicit call to a
Singleton::GetInstance() method ! 


>>The reason is that I'm providing a library that encapsulate omniORB
and provide another object API that do not have a kind of Initialize
methods that MUST be called first prior of  others calls. 


You could just have your API keep an internal initialized flag and for
every method call into it, make sure it is initialized, and if not, call
the GetInstance() method first... 



ScottR

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20040915/dd270517/attachment.htm


More information about the omniORB-list mailing list