Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ab9aadb

Browse filesBrowse files
committed
More overlapped implementation
1 parent d46bcd9 commit ab9aadb
Copy full SHA for ab9aadb

File tree

1 file changed

+19
-0
lines changed
Filter options

1 file changed

+19
-0
lines changed

‎stdlib/src/overlapped.rs

Copy file name to clipboardExpand all lines: stdlib/src/overlapped.rs
+19Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ mod _overlapped {
1616
stdlib::os::errno_err,
1717
types::Constructor,
1818
};
19+
use rustpython_vm::{Py, PyResult};
1920
use windows_sys::Win32::{
2021
Foundation::{self, GetLastError, HANDLE},
2122
Networking::WinSock::SOCKADDR_IN6,
@@ -354,4 +355,22 @@ mod _overlapped {
354355
]);
355356
Ok(value.into())
356357
}
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+
}
357376
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.