def createOrb():
'''
Calls the omniorbpy CORBA.ORB_init() method in a thread. Calling the method in a thread
allows us to set a timeout for the ORB_init() call, as it will never return if the system
has run out of threads.
Return None on failure.
'''
# create a queue with one slot to hold the orb
queue = Queue(maxsize=1)
def orbCreator():
"""
A method to pass to callOmniorbpyWithTimeout.
"""
orb = CORBA.ORB_init()
queue.put(orb)
orb = callOmniorbpyWithTimeout(orbCreator, queue)
if orb == None:
logging.error("omniorbpy failed to return from ORB_init. This is often a result of an insufficient amount of threads available on the system.")
sys.exit(-1)
return orb
评论列表
文章目录