+
    :iN                     |   ^ RI t ^ RIt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H
t
 ^ RIHt ^ RIHtHtHt ] P"                  P$                  t] P&                  ]n        . ]n        ]P,                  R8X  d=   ] P.                  P0                  P2                  t] P6                  .]n        R]n        ^tMZ] P:                  ! ] P<                  P?                  R4      4      P@                  t] P6                  .]n        ] PB                  ]n        RtR t"R	t#R
 t$R t% ! R R]4      t&]'R8X  d   ]PP                  ! 4        R# R# )    N)jit)errors)TestCasetagskip_if_freethreadingntci  c                 \    V F%  p\        ^
\        ,          4       \        4       W&   K'  	  R# )
   N)sleepsleep_factorPyThread_get_thread_identaindicesidxs   && R/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/tests/test_gil.pyfr   "   s%    
 b< *,     zvoid(int64[:], intp[:])c                p    \        4        V F%  p\        ^
\        ,          4       \        4       W&   K'  	  R# )z'
Same as f(), but inside a lifted loop
N)objectr   r   r   r   s   && r   lifted_fr   .   s*     Hb< *, r   c                p    V F/  p\        ^
\        ,          4       \        4        \        4       W&   K1  	  R# )z!
Same as f(), but in object mode
N)r   r   r   r   r   s   && r   object_fr   8   s*     b< *,	 r   c                   v   a  ] tR t^Ct o R tR tR tR t]R 4       t	R t
R tR tR	 t]R
 4       tR tRtV tR# )TestGILReleasec                N    \         P                  ! V\         P                  R 7      # )dtype)nparangeint64)self	n_memberss   &&r   make_test_arrayTestGILRelease.make_test_arrayE   s    yy"((33r   c                   . pV! V P                  ^4      \        P                  ! ^\        P                  R7      4       V P                  ^24      p\	        V4       F|  p\        P                  ! VP
                  \        P                  R7      p\        P                  P                  V4       \        P                  ! WV3R7      pVP                  V4       K~  	  V F  pVP                  4        K  	  V F  pVP                  4        K  	  V# )   r   )targetargs)r%   r    r!   intprangesizerandomshuffle	threadingThreadappendstartjoin)r#   func	n_threadsthreadsarrir   ts   &&&     r   run_in_threadsTestGILRelease.run_in_threadsH   s     	T!!!$bii&AB""2&y!A ii8GIIg&  >BANN1 " AGGI AFFH 
r   c                z    V P                  V^R7      p\        V4      pV P                  \        V4      ^V4       R# )   )r6   N)r;   setassertEquallen)r#   r5   r8   distincts   &&  r   check_gil_heldTestGILRelease.check_gil_held\   s6    !!$!!4s8X84r   c                    R F=  pV P                  W4      p\        V4      p V P                  \        V4      ^V4        R# 	  Xh  \         d   pTp Rp?KV  Rp?ii ; i)r>   N)r>          )r;   r?   assertGreaterrA   AssertionError)r#   r5   r6   r8   rB   efailures   &&     r   check_gil_released!TestGILRelease.check_gil_releaseda   se    $I %%d6C3xH""3x=!X>  % 	 " s   AAAAc                ^    \        \        RR7      ! \        4      pV P                  V4       R# )z]
Test the GIL is held by default, by checking serialized runs
produce deterministic results.
TnopythonNr   f_sigr   rC   r#   cfuncs   & r   test_gil_heldTestGILRelease.test_gil_heldo   s#     ED)!,E"r   c                `    \        \        RRR7      ! \        4      pV P                  V4       R# )zR
Test releasing the GIL, by checking parallel runs produce
unpredictable results.
TrP   nogilNr   rR   r   rL   rS   s   & r   test_gil_released TestGILRelease.test_gil_releasedx   s%    
 ED5a8&r   c                `    \        \        RRR7      ! \        4      pV P                  V4       R# )zb
Test the GIL can by released by a lifted loop even though the
surrounding code uses object mode.
TforceobjrY   N)r   rR   r   rL   rS   s   & r   $test_gil_released_inside_lifted_loop3TestGILRelease.test_gil_released_inside_lifted_loop   s%    
 ED5h?&r   c                   a \        \        RR7      ! \        4      o\        \        RRR7      V3R l4       pV P                  V4       R# )zP
Releasing the GIL in the caller is sufficient to have it
released in a callee.
TrO   rX   c                    < S! W4       R # N r   r9   
compiled_fs   &&r   caller:TestGILRelease.test_gil_released_by_caller.<locals>.caller       qr   NrZ   r#   rh   rg   s   & @r   test_gil_released_by_caller*TestGILRelease.test_gil_released_by_caller   s?    
 .q1
	UT	.	 
/	'r   c                   a \        \        RRR7      ! \        4      o\        \        RRR7      V3R l4       pV P                  V4       R# )zB
Same, but with both caller and callee asking to release the GIL.
TrX   c                    < S! W4       R # rd   re   rf   s   &&r   rh   ETestGILRelease.test_gil_released_by_caller_and_callee.<locals>.caller   rj   r   NrZ   rk   s   & @r   &test_gil_released_by_caller_and_callee5TestGILRelease.test_gil_released_by_caller_and_callee   sA     T:1=
	UT	.	 
/	'r   c                   a \        \        RRR7      ! \        4      o\        \        RR7      V3R l4       pV P                  V4       R# )z@
When only the callee asks to release the GIL, it gets ignored.
TrX   rO   c                    < S! W4       R # rd   re   rf   s   &&r   rh   9TestGILRelease.test_gil_ignored_by_callee.<locals>.caller   rj   r   NrQ   rk   s   & @r   test_gil_ignored_by_callee)TestGILRelease.test_gil_ignored_by_callee   s?    
 T:1=
	UT	"	 
#	F#r   c                   \         P                  ! RR7      ;_uu_ 4       p\         P                  ! R\        P                  4       \        \        RRR7      ! \        4      pRRR4       T P                  \        ;QJ d    R X 4       F  '       g   K   RM	  RM! R X 4       4      V4       V P                  X^4       R#   + '       g   i     Lh; i)zI
When the function is compiled in object mode, a warning is
printed out.
T)recordalwaysr^   Nc              3      "   T FA  pVP                   \        P                  J ;'       d    R \        VP                  4      9   x  KC  	  R# 5i)z:Code running in object mode won't allow parallel executionN)categoryr   NumbaWarningstrmessage).0ws   & r   	<genexpr>2TestGILRelease.test_object_mode.<locals>.<genexpr>   sM      ,%* JJ&*=*== o o \`cdedmdm`n no%*s
   'A!AF)warningscatch_warningssimplefilterr   r}   r   rR   r   
assertTrueanyr;   )r#   wlistrT   s   &  r   test_object_modeTestGILRelease.test_object_mode   s    
 $$D11U!!(F,?,?@D9(CE 2 	 ,%*, ,%*, ,-2	4 	E1% 21s   ACC	re   N)__name__
__module____qualname____firstlineno__r%   r;   rC   rL   r   rU   r[   r`   rl   rq   rv   r   __static_attributes____classdictcell__)__classdict__s   @r   r   r   C   s_     4(5
 # #''	(( $ $& &r   r   __main__))ctypesctypes.utilossysr0   r   numpyr    unittestnumbar   
numba.corer   numba.tests.supportr   r   r   	pythonapir   c_longrestypeargtypesnamewindllkernel32Sleepr   c_uintr   CDLLutilfind_libraryusleepc_intr   rR   r   r   r   r   mainre   r   r   <module>r      s     	 
       D D #,,FF $*MM  !%'  " 77d?MM""((Emm_ENEMLKK0056==Emm_ENLLEML- 	"--q&X q&h zMMO r   