File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import _thread
2+
3+ assert _thread .TIMEOUT_MAX in [9223372036.0 , 4294967.0 ]
Original file line number Diff line number Diff line change @@ -5,6 +5,14 @@ use crate::function::PyFuncArgs;
55use crate :: pyobject:: PyResult ;
66use crate :: vm:: VirtualMachine ;
77
8+ #[ cfg( not( target_os = "windows" ) ) ]
9+ const PY_TIMEOUT_MAX : isize = std:: isize:: MAX ;
10+
11+ #[ cfg( target_os = "windows" ) ]
12+ const PY_TIMEOUT_MAX : isize = 0xffffffff * 1_000_000 ;
13+
14+ const TIMEOUT_MAX : f64 = ( PY_TIMEOUT_MAX / 1_000_000_000 ) as f64 ;
15+
816fn rlock_acquire ( vm : & VirtualMachine , _args : PyFuncArgs ) -> PyResult {
917 Ok ( vm. get_none ( ) )
1018}
@@ -54,5 +62,6 @@ pub fn make_module(vm: &VirtualMachine) -> PyObjectRef {
5462 "RLock" => rlock_type,
5563 "get_ident" => ctx. new_rustfunc( get_ident) ,
5664 "allocate_lock" => ctx. new_rustfunc( allocate_lock) ,
65+ "TIMEOUT_MAX" => ctx. new_float( TIMEOUT_MAX ) ,
5766 } )
5867}
You can’t perform that action at this time.
0 commit comments