文件操作 - _pool.cpython-310.pyc
返回文件管理
返回主菜单
删除本文件
文件: /usr/lib/python3/dist-packages/twisted/_threads/__pycache__/_pool.cpython-310.pyc
编辑文件内容
o �b� � @ s\ d Z ddlmZ ddlmZmZmZ ddlm Z ddl mZ ddlm Z mZ efdd �Zd S )zR Top level thread pool interface, used to implement L{twisted.python.threadpool}. � )�Queue)�Lock�Thread�local)�err� )�Team)� LockWorker�ThreadWorkerc s8 �fdd��� ��fdd�}t tt� t� �|td���S )a; Construct a L{Team} that spawns threads as a thread pool, with the given limiting function. @note: Future maintainers: while the public API for the eventual move to twisted.threads should look I{something} like this, and while this function is necessary to implement the API described by L{twisted.python.threadpool}, I am starting to think the idea of a hard upper limit on threadpool size is just bad (turning memory performance issues into correctness issues well before we run into memory pressure), and instead we should build something with reactor integration for slowly releasing idle threads when they're not needed and I{rate} limiting the creation of new threads rather than just hard-capping it. @param currentLimit: a callable that returns the current limit on the number of workers that the returned L{Team} should create; if it already has more workers than that value, no new workers will be created. @type currentLimit: 0-argument callable returning L{int} @param threadFactory: Factory that, when given a C{target} keyword argument, returns a L{threading.Thread} that will run that target. @type threadFactory: callable returning a L{threading.Thread} @return: a new L{Team}. c s � | d�� � S )N��target)�startr )� threadFactory� �8/usr/lib/python3/dist-packages/twisted/_threads/_pool.py�startThread0 s zpool.<locals>.startThreadc s* �� � } | j| j � � krd S t�t� �S )N)� statistics�busyWorkerCount�idleWorkerCountr r )�stats)�currentLimitr �teamr r �limitedWorkerCreator3 s z"pool.<locals>.limitedWorkerCreator)�coordinator�createWorker�logException)r r r �LocalStorager )r r r r )r r r r r �pool s �r N)�__doc__�queuer � threadingr r r r �twisted.python.logr �_teamr � _threadworkerr r r r r r r �<module> s
修改文件时间
将文件时间修改为当前时间的前一年
删除文件