def activeCount():
with _active_limbo_lock:
return len(_active) + len(_limbo)
doQuit = 1
if len(sys.argv)>1 and sys.argv[1] == '-q':
doQuit = 0
nT = threading.activeCount()
app = MyApp(0)
activePort = app.frame.rpcPort
t = threading.Thread(target=lambda x=activePort:testcon(x),verbose=0)
t.start()
app.MainLoop()
# give the threads time to shut down
if threading.activeCount() > nT:
print 'waiting for all threads to terminate'
while threading.activeCount() > nT:
src/r/o/roreditor-HEAD/lib_windows/wx/lib/rpcMixin.py roreditor(Download)
doQuit = 1
if len(sys.argv)>1 and sys.argv[1] == '-q':
doQuit = 0
nT = threading.activeCount()
app = MyApp(0)
activePort = app.frame.rpcPort
t = threading.Thread(target=lambda x=activePort:testcon(x),verbose=0)
t.start()
app.MainLoop()
# give the threads time to shut down
if threading.activeCount() > nT:
print 'waiting for all threads to terminate'
while threading.activeCount() > nT:
src/m/i/milkcrate-HEAD/MoinMoin/server/standalone.py milkcrate(Download)
def process_request(self, request, client_address):
""" Start a new thread to process the request
If the thread limit has been reached, wait on the lock. The
next thread will notify when finished.
"""
from threading import Thread, activeCount
self.lock.acquire()
try:
if activeCount() > self.thread_limit:
src/s/k/skink-HEAD/skink/lib/cherrypy/process/plugins.py skink(Download)
# "The general problem with making fork() work in a multi-threaded
# world is what to do with all of the threads..."
# So we check for active threads:
if threading.activeCount() != 1:
self.bus.log('There are %r active threads. '
'Daemonizing now may cause strange failures.' %
threading.enumerate(), level=30)
src/e/d/EDDIE-Tool-1.0.0/eddietool/commands.py EDDIE-Tool(Download)
while not die_event.isSet():
loop_start = time.time() # get time when loop started
while threading.activeCount() > config.num_threads:
# do nothing while we have no active threads to play with
# TODO: if we wait too long, something is probably wrong, so do something about it...
log.log( "<eddie>scheduler(): active thread count is %d - waiting till <= %d" % (threading.activeCount(),config.num_threads), 8 )
if time.time() - loop_start > 30*60:
# if this loop has been running for over 30 mins, then all
# threads are locked badly and something is wrong. Force an
# exit...
# (there is no ability to kill threads in current Python implementation)
log.log( "<eddie>scheduler(): active thread count has been %d for over %d mins - forcing exit" % (threading.activeCount(), (time.time()-loop_start)/60), 1 )
#numfds = countFDs()
#log.log( "<eddie>main(): FDs in use = %d." % (numfds), 8 )
log.log( "<eddie>main(): Threads in use = %d." % (threading.activeCount()), 8 )
log.log( "<eddie>main(): Threads: %s" % (threading.enumerate()), 8 )
# check if any config/rules files have been modified
src/o/p/openautomation-HEAD/PyWireGate/trunk/cycler.py openautomation(Download)
def _check(self):
self.debug("Cycle")
try:
self.mutex.acquire()
print "acitve tasks %d " % threading.activeCount()
atasks = "Active tasks: "
for rtask in threading.enumerate():
self.mutex.acquire()
self.taskList = []
for task in self.running.keys():
print "acitve tasks %d " % threading.activeCount()
print "cancel task %r" % task.args
try:
rtask = self.running.pop(task)
cycle.remove(cycle2)
#cycle.shutdown()
#cycle.add(6,write_time,"task4!")
while threading.activeCount() > 1:
time.sleep(1)
except KeyboardInterrupt:
cycle.shutdown()
src/w/e/wecowi-HEAD/trunk/tools/pywecowi/imagecopy.py wecowi(Download)
if not skip:
imageTransfer(imagepage, newname).start()
wikipedia.output(u'Still ' + str(threading.activeCount()) + u' active threads, lets wait')
for openthread in threading.enumerate():
if openthread != threading.currentThread():
openthread.join()
src/f/o/Forban-HEAD/lib/ext/cherrypy/process/plugins.py Forban(Download)
# "The general problem with making fork() work in a multi-threaded
# world is what to do with all of the threads..."
# So we check for active threads:
if threading.activeCount() != 1:
self.bus.log('There are %r active threads. '
'Daemonizing now may cause strange failures.' %
threading.enumerate(), level=30)
src/w/e/wecowi-HEAD/tools/pywecowi/imagecopy.py wecowi(Download)
if not skip:
imageTransfer(imagepage, newname).start()
wikipedia.output(u'Still ' + str(threading.activeCount()) + u' active threads, lets wait')
for openthread in threading.enumerate():
if openthread != threading.currentThread():
openthread.join()
src/b/e/benchit-HEAD/trunk/lib/cherrypy/process/plugins.py benchit(Download)
# "The general problem with making fork() work in a multi-threaded
# world is what to do with all of the threads..."
# So we check for active threads:
if threading.activeCount() != 1:
self.bus.log('There are %r active threads. '
'Daemonizing now may cause strange failures.' %
threading.enumerate(), level=30)
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next