def timer(startTime):
global TIME_OUT_SIGNAL
print ("in timerThread")
sleepTime=10
slice=options.timelimit
total=0
while (1):
stopTime=time.time()
totalTime=stopTime - startTime
# print "in timerThread, total time now %f" %(total)
if (slice * 2 <= totalTime):
print "****Error in spark:too long time!"
thread.interrupt_main()
thread.exit()
if (slice <= totalTime):
print "timer:timeLock is locked!"
break
time.sleep(sleepTime)
print "total time:%f" % (totalTime)
TIME_OUT_SIGNAL=True
# on_signal_usr1(0,0)
# os.kill(pid,signal.SIGUSR1)
评论列表
文章目录