def callOmniorbpyWithTimeout(method, queue, pollPeriodSeconds = 0.001, timeoutSeconds = 1):
"""
Some omniorbpy methods have been found to hang if the system runs out of
threads. Call method and wait for up to timeoutSeconds. If the method
returns within timeoutSeconds, return the value placed on the queue;
otherwise, return None.
"""
thread = threading.Thread(target = method)
try:
thread.start()
except:
# If the system is out of threads, the thread.start() method can
# potentially fail.
return None
return _pollQueue(queue,
pollPeriodSeconds = pollPeriodSeconds,
timeoutSeconds = timeoutSeconds)
评论列表
文章目录