MCPcopy Create free account
hub / github.com/clMathLibraries/clFFT / f2

Function f2

src/scripts/perf/performanceUtility.py:66–84  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

64def timeout(timeout_time, default):
65 def timeout_function(f):
66 def f2(args):
67 def timeout_handler(signum, frame):
68 raise errorHandler.TimeoutException()
69
70 old_handler = signal.signal(signal.SIGALRM, timeout_handler)
71 signal.alarm(timeout_time) # triger alarm in timeout_time seconds
72 retval = ""
73 try:
74 retval = f(args)
75 except errorHandler.TimeoutException:
76 raise errorHandler.ApplicationException(__file__, errorHandler.TIME_OUT)
77 except:
78 signal.alarm(0)
79 raise
80 finally:
81 #print 'executing finally'
82 signal.signal(signal.SIGALRM, old_handler)
83 signal.alarm(0)
84 return retval
85 return f2
86 return timeout_function
87

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected