HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //usr/local/lib/python3.9/site-packages/billiard/__pycache__/synchronize.cpython-39.pyc
a

X>h�2�@srddlZddlZddlZddlZddlmZddlmZddlmZddlm	Z	m
Z
ddlmZgd�Z
e
�eed	��\ZZe	jjZze	jjZWn:ey�zdd
lmZWney�dZYn0Yn0dd�ZGd
d�d�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�d�ZGdd�d�Zeed��r`Gdd�dej �Z nGdd�d�Z dS)�N�)�context)�process)�util)�	_billiard�ensure_SemLock)�	monotonic)�Lock�RLock�	Semaphore�BoundedSemaphore�	Condition�Event�)�
sem_unlinkcCs z|jWStyYn0dS�N)�name�AttributeError)�sl�r�>/usr/local/lib/python3.9/site-packages/billiard/synchronize.py�_semname4src@s^eZdZe��Zddd�Zedd��Zdd�Z	dd	�Z
d
d�Zdd
�Zdd�Z
edd��ZdS)�SemLockNcCsL|durtj��}|��}tjdkp*|dk}tr�td�D]f}z t�	||||�
�|�}|_Wn<tt
fy�}	z t|	dd�tjkr��WYd}	~	q8d}	~	00q�q8t
d�}	tj|	_|	�nt�	|||�}|_t�d|j�|��t�rHtjdk�rdd�}
t�||
�t|j�du�rHd	d
lm}||jj�tj|t	j|jjfdd�dS)
N�win32�fork�d�errnozcannot find file for semaphorezcreated semlock with handle %scSs|j��dSr)�_semlock�_after_fork)�objrrrr[sz%SemLock.__init__.<locals>._after_forkr)�registerr)Zexitpriority)rZ_default_contextZget_contextZget_start_method�sys�platformr�rangerr�
_make_namer�OSError�IOError�getattrr�EEXISTr�debug�handle�
_make_methodsZregister_after_forkr�semaphore_trackerr rZFinalize�_cleanup)�self�kind�value�maxvalue�ctxrZ
unlink_now�ir�excrr rrr�__init__>s<
��zSemLock.__init__cCs ddlm}t|�||�dS)Nr)�
unregister)r,r6r)rr6rrrr-hszSemLock._cleanupcCs|jj|_|jj|_dSr)r�acquire�release�r.rrrr+ns
zSemLock._make_methodscCs
|j��Sr)r�	__enter__r9rrrr:rszSemLock.__enter__cGs|jj|�Sr)r�__exit__�r.�argsrrrr;uszSemLock.__exit__cCsht�|�|j}tjdkr,t���|j�}n|j}||j|j	f}z||j
f7}WntybYn0|S)Nr)r�assert_spawningrr!r"Zget_spawning_popenZduplicate_for_childr*r/r1rr)r.r�h�staterrr�__getstate__xs

zSemLock.__getstate__cCs*tjj|�|_t�d|d�|��dS)Nz recreated blocker with handle %rr)rrZ_rebuildrrr)r+�r.r@rrr�__setstate__�szSemLock.__setstate__cCsdt��jdttj�fS)Nz%s-%sZ	semprefix)r�current_process�_config�nextr�_randrrrrr$�s�zSemLock._make_name)N)�__name__�
__module__�__qualname__�tempfile�_RandomNameSequencerGr5�staticmethodr-r+r:r;rArCr$rrrrr;s
*
rc@s&eZdZd	dd�Zdd�Zdd�ZdS)
rrNcCstj|t|t|d�dS�N�r2)rr5�	SEMAPHORE�
SEM_VALUE_MAX�r.r0r2rrrr5�szSemaphore.__init__cCs
|j��Sr)r�
_get_valuer9rrr�	get_value�szSemaphore.get_valuecCs6z|j��}Wnty$d}Yn0d|jj|fS)N�unknownz<%s(value=%s)>)rrS�	Exception�	__class__rH�r.r0rrr�__repr__�s

zSemaphore.__repr__)rN)rHrIrJr5rTrYrrrrr�s
rc@seZdZddd�Zdd�ZdS)rrNcCstj|t|||d�dSrN�rr5rPrRrrrr5�szBoundedSemaphore.__init__cCs<z|j��}Wnty$d}Yn0d|jj||jjfS)NrUz<%s(value=%s, maxvalue=%s)>)rrSrVrWrHr1rXrrrrY�s
�zBoundedSemaphore.__repr__)rN)rHrIrJr5rYrrrrr�s
rc@s"eZdZdZddd�Zdd�ZdS)r	z
    Non-recursive lock.
    NcCstj|tdd|d�dS�NrrOrZ�r.r2rrrr5�sz
Lock.__init__cCs�zf|j��r8t��j}t��jdkrd|dt��j7}n,|j��dkrLd}n|j��dkr`d}nd}Wnt	y|d}Yn0d	|j
j|fS)
N�
MainThread�|r�Noner�SomeOtherThread�SomeOtherProcessrUz<%s(owner=%s)>)r�_is_minerrDr�	threading�current_threadrS�_countrVrWrH)r.rrrrrY�s


z
Lock.__repr__)N�rHrIrJ�__doc__r5rYrrrrr	�s
r	c@s"eZdZdZddd�Zdd�ZdS)r
z
    Recursive lock
    NcCstj|tdd|d�dSr[)rr5�RECURSIVE_MUTEXr\rrrr5�szRLock.__init__cCs�z||j��rBt��j}t��jdkr6|dt��j7}|j��}n8|j��dkrZd\}}n |j��dkrrd\}}nd\}}Wnt	y�d\}}Yn0d	|j
j||fS)
Nr]r^r)r_rr)r`�nonzero)rari)rUrU�<%s(%s, %s)>)rrbrrDrrcrdrerSrVrWrH)r.r�countrrrrY�s



zRLock.__repr__)Nrfrrrrr
�s
r
c@sneZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
ddd�Zdd�Zdd�Z
ddd�ZdS)r
z
    Condition variable
    NcCsF|sJ�|p|��|_|�d�|_|�d�|_|�d�|_|��dS�Nr)r
�_lockr�_sleeping_count�_woken_count�_wait_semaphorer+)r.�lockr2rrrr5�szCondition.__init__cCst�|�|j|j|j|jfSr)rr>rmrnrorpr9rrrrA�s
�zCondition.__getstate__cCs |\|_|_|_|_|��dSr)rmrnrorpr+rBrrrrC�s�
zCondition.__setstate__cCs
|j��Sr)rmr:r9rrrr:�szCondition.__enter__cGs|jj|�Sr)rmr;r<rrrr;�szCondition.__exit__cCs|jj|_|jj|_dSr)rmr7r8r9rrrr+�s
zCondition._make_methodscCsHz|jj��|jj��}Wnty2d}Yn0d|jj|j|fS)NrUrj)rnrrSrorVrWrHrm)r.Znum_waitersrrrrYs

�
�zCondition.__repr__c	Cs�|jj��sJd��|j��|jj��}t|�D]}|j��q2zD|j�d|�W|j	��t|�D]}|j��qdS]}|j��qvn$|j	��t|�D]}|j��q�0dS)Nz,must acquire() condition before using wait()T)
rmrrbrnr8rer#rpr7ro)r.�timeoutrkr3rrr�waits&�

��
zCondition.waitcCsv|jj��sJd��|j�d�r$J�|j�d�rF|j�d�}|s$J�q$|j�d�rr|j��|j��|j�d�dS)N�lock is not ownedF)rmrrbrpr7rornr8)r.�resrrr�notify#s


zCondition.notifycCs�|jj��sJd��|j�d�r$J�|j�d�rF|j�d�}|s$J�q$d}|j�d�rj|j��|d7}qJ|r�t|�D]}|j��qv|j�d�r�q�dS)NrtFrr)	rmrrbrpr7rornr8r#)r.ruZsleepersr3rrr�
notify_all4s


zCondition.notify_allcCs`|�}|r|S|dur"t�|}nd}d}|s\|durJ|t�}|dkrJq\|�|�|�}q*|Srl)rrs)r.�	predicaterr�result�endtime�waittimerrr�wait_forKs

zCondition.wait_for)NN)N)N)rHrIrJrgr5rArCr:r;r+rYrsrvrwr|rrrrr
�s
	
r
c@s8eZdZddd�Zdd�Zdd�Zdd	�Zd
d
d�ZdS)rNcCs(|sJ�|�|���|_|�d�|_dSrl)r
r	�_condr�_flagr\rrrr5`szEvent.__init__cCsR|j�8|j�d�r.|j��Wd�dSWd�dS1sD0YdS�NFT)r}r~r7r8r9rrr�is_setes

zEvent.is_setcCsJ|j�0|j�d�|j��|j��Wd�n1s<0YdS�NF)r}r~r7r8rwr9rrr�setls
z	Event.setcCs6|j�|j�d�Wd�n1s(0YdSr�)r}r~r7r9rrr�clearrszEvent.clearcCsv|j�\|j�d�r |j��n|j�|�|j�d�rR|j��Wd�dSWd�dS1sh0YdSr)r}r~r7r8rs)r.rrrrrrsvs
z
Event.wait)N)N)rHrIrJr5r�r�r�rsrrrrr^s

r�Barrierc@sZeZdZddd�Zdd�Zdd�Zedd	��Zejd
d	��Zedd��Z	e	jd
d��Z	dS)r�Nc	CsZ|sJ�ddl}ddlm}||�d�d�}|��}|�|||||f�d|_d|_dS)Nrr)�
BufferWrapperr3r)�struct�heapr��calcsizer
rC�_statere)	r.�parties�actionrrr2r�r��wrapperZcondrrrr5�s�Barrier.__init__cCs.|\|_|_|_|_|_|j���d�|_dS)Nr3)�_parties�_action�_timeoutr}�_wrapperZcreate_memoryview�cast�_arrayrBrrrrC�s�zBarrier.__setstate__cCs|j|j|j|j|jfSr)r�r�r�r}r�r9rrrrA�s�zBarrier.__getstate__cCs
|jdSrl�r�r9rrrr��szBarrier._statecCs||jd<dSrlr�rXrrrr��scCs
|jdS�Nrr�r9rrrre�szBarrier._countcCs||jd<dSr�r�rXrrrre�s)NNN)
rHrIrJr5rCrA�propertyr��setterrerrrrr��s




c@seZdZdd�ZdS)r�cOstd��dS)NzBarrier only supported on Py3)�NotImplementedError)r.r=�kwargsrrrr5�sr�N)rHrIrJr5rrrrr��s)!rr!rKrc�rrrZ_extrr�timer�__all__�listr#rhrPrrQrr�_multiprocessing�ImportErrorrrrr	r
r
r�hasattrr�rrrr�<module>
s<V|)(