File tree 1 file changed +19
-0
lines changed
Filter options
1 file changed +19
-0
lines changed
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ mod _overlapped {
16
16
stdlib:: os:: errno_err,
17
17
types:: Constructor ,
18
18
} ;
19
+ use rustpython_vm:: { Py , PyResult } ;
19
20
use windows_sys:: Win32 :: {
20
21
Foundation :: { self , GetLastError , HANDLE } ,
21
22
Networking :: WinSock :: SOCKADDR_IN6 ,
@@ -354,4 +355,22 @@ mod _overlapped {
354
355
] ) ;
355
356
Ok ( value. into ( ) )
356
357
}
358
+
359
+ #[ pyfunction]
360
+ fn SetEvent ( handle : HANDLE ) -> PyResult < ( ) > {
361
+ let ret = unsafe { windows_sys:: Win32 :: System :: Threading :: SetEvent ( handle) } ;
362
+ if ret == 0 {
363
+ return Err ( errno_err ( vm) ) ;
364
+ }
365
+ Ok ( ( ) )
366
+ }
367
+
368
+ #[ pyfunction]
369
+ fn ResetEvent ( handle : HANDLE ) -> PyResult < ( ) > {
370
+ let ret = unsafe { windows_sys:: Win32 :: System :: Threading :: ResetEvent ( handle) } ;
371
+ if ret == 0 {
372
+ return Err ( errno_err ( vm) ) ;
373
+ }
374
+ Ok ( ( ) )
375
+ }
357
376
}
You can’t perform that action at this time.
0 commit comments