HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //var/opt/nydus/ops/mysql/opentelemetry/util/__pycache__/_once.cpython-39.pyc
a

�,�h��@s*ddlmZddlmZGdd�d�ZdS)�)�Lock)�Callablec@s6eZdZdZdd�dd�Zegdfed�dd�ZdS)	�Oncez�Execute a function exactly once and block all callers until the function returns

    Same as golang's `sync.Once <https://pkg.go.dev/sync#Once>`_
    N)�returncCst�|_d|_dS)NF)r�_lock�_done)�self�r	�Q/opt/nydus/tmp/pip-target-wkfpz8uv/lib64/python/mysql/opentelemetry/util/_once.py�__init__sz
Once.__init__)�funcrcCsV|jr
dS|j�2|js4|�d|_Wd�dSWd�n1sH0YdS)z�Execute ``func`` if it hasn't been executed or return.

        Will block until ``func`` has been called by one thread.

        Returns:
            Whether or not ``func`` was executed in this call
        FTN)rr)rrr	r	r
�do_onces
.zOnce.do_once)�__name__�
__module__�__qualname__�__doc__rr�boolr
r	r	r	r
rsrN)�	threadingr�typingrrr	r	r	r
�<module>s