Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/cheroot/__pycache__/connections.cpython-39.pyc
Ðазад
a p�h�: � @ s d Z ddlZddlZddlZddlZddlZddlZddlmZ ddl m Z ddlmZ ddl mZ zddlZW n| ey� zFddlmZmZ ddlZejjZejjejjejjge_ejje_W n ey� d d � ZY n 0 dd � ZY n 0 dd � ZG d d� d�ZG dd� d�Z dS )z%Utilities to manage open connections.� N)�suppress� )�errors)� IS_WINDOWS)�MakeFile)�windll�WinErrorc C s dS )ztStub inheritance prevention. Dummy function, since neither fcntl nor ctypes are available. N� ��sockr r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/cheroot/connections.py�prevent_socket_inheritance s r c C s t | �� dd�st� �dS )z6Mark the given socket fd as non-inheritable (Windows).r r N)�_SetHandleInformation�filenor r r r r r $ s c C s0 | � � }t�|tj�}t�|tj|tjB � dS )z4Mark the given socket fd as non-inheritable (POSIX).N)r �fcntlZF_GETFDZF_SETFDZ FD_CLOEXEC)r �fdZ old_flagsr r r r ) s c @ sP e Zd ZdZdd� Zdd� Zedd� �Zdd d �Zdd� Z dd d�Z dd� ZdS )�_ThreadsafeSelectora� Thread-safe wrapper around a DefaultSelector. There are 2 thread contexts in which it may be accessed: * the selector thread * one of the worker threads in workers/threadpool.py The expected read/write patterns are: * :py:func:`~iter`: selector thread * :py:meth:`register`: selector thread and threadpool, via :py:meth:`~cheroot.workers.threadpool.ThreadPool.put` * :py:meth:`unregister`: selector thread only Notably, this means :py:class:`_ThreadsafeSelector` never needs to worry that connections will be removed behind its back. The lock is held when iterating or modifying the selector but is not required when :py:meth:`select()ing <selectors.BaseSelector.select>` on it. c C s t �� | _t�� | _d S �N)� selectors�DefaultSelector� _selector� threading�Lock�_lock��selfr r r �__init__D s z_ThreadsafeSelector.__init__c C s<