mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
deps: Switch from winapi
to windows_sys
in Servo code (#32516)
This is part of the switch from `winapi` to `windows-sys`. `windows-sys` is maintained by Microsoft, so is more "official." More and more crates are switching to it.
This commit is contained in:
parent
8b35c4094a
commit
e902d63732
7 changed files with 20 additions and 20 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
use crate::sampler::{NativeStack, Sampler};
|
||||
|
||||
type MonitoredThreadId = usize; // TODO: use winapi
|
||||
type MonitoredThreadId = usize; // TODO: use the `windows` crate to do this.
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub struct WindowsSampler {
|
||||
|
@ -14,7 +14,7 @@ pub struct WindowsSampler {
|
|||
impl WindowsSampler {
|
||||
#[allow(unsafe_code, dead_code)]
|
||||
pub fn new_boxed() -> Box<dyn Sampler> {
|
||||
let thread_id = 0; // TODO: use winapi::um::processthreadsapi::GetThreadId
|
||||
let thread_id = 0; // TODO: use windows::Win32::System::Threading::GetThreadId
|
||||
Box::new(WindowsSampler { thread_id })
|
||||
}
|
||||
}
|
||||
|
@ -28,11 +28,11 @@ impl Sampler for WindowsSampler {
|
|||
// or any other unshareable resource.
|
||||
|
||||
// TODO:
|
||||
// 1: use winapi::um::processthreadsapi::SuspendThread
|
||||
// 2: use winapi::um::processthreadsapi::GetThreadContext
|
||||
// 1: use windows::Win32::Threading::SuspendThread
|
||||
// 2: use windows::Win32::Threading::GetThreadContext
|
||||
// 3: populate registers using the context, see
|
||||
// https://dxr.mozilla.org/mozilla-central/source/tools/profiler/core/platform-win32.cpp#129
|
||||
// 4: use winapi::um::processthreadsapi::ResumeThread
|
||||
// 4: use windows::Win32::Threading::ResumeThread
|
||||
|
||||
// NOTE: End of "critical section".
|
||||
Err(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue