浏览代码

Adds celery.utils.threads.active_count

Ask Solem 13 年之前
父节点
当前提交
144e352ee7
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      celery/utils/threads.py

+ 3 - 0
celery/utils/threads.py

@@ -8,6 +8,9 @@ import traceback
 _Thread = threading.Thread
 _Event = threading._Event
 
+active_count = (getattr(threading, "active_count", None) or
+                threading.activeCount)
+
 
 class Event(_Event):