Rename ports/winit package to servoshell (#30163)

* rename winit package to servoshell

* revert previous changes and rename only package
This commit is contained in:
Atbrakhi 2023-08-28 16:36:57 +02:00 committed by GitHub
parent cc4fe4981f
commit 66567faeb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 39 additions and 39 deletions

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
<key>CFBundleDisplayName</key>
<string>Servo</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleName</key>
<string>Servo</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright &#169; 2016 The Servo Authors</string>
<key>CFBundleVersion</key>
<string>0.0.1</string>
<key>CFBundleIdentifier</key>
<string>org.servo.servo</string>
</dict>
</plist>

View file

@ -0,0 +1,13 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
#include <mach/mach.h>
int macos_count_running_threads() {
task_t task = current_task();
thread_act_array_t threads;
mach_msg_type_number_t tcnt;
task_threads(task, &threads, &tcnt);
return tcnt;
}

View file

@ -0,0 +1,46 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::ptr;
use std::thread;
use std::time::Duration;
pub fn deinit(clean_shutdown: bool) {
// An unfortunate hack to make sure the linker's dead code stripping doesn't strip our
// `Info.plist`.
unsafe {
ptr::read_volatile(&INFO_PLIST[0]);
}
let thread_count = unsafe { macos_count_running_threads() };
if thread_count != 1 {
println!(
"{} threads are still running after shutdown (bad).",
thread_count
);
if clean_shutdown {
println!("Waiting until all threads have shutdown");
loop {
let thread_count = unsafe { macos_count_running_threads() };
if thread_count == 1 {
break;
}
thread::sleep(Duration::from_millis(1000));
println!("{} threads are still running.", thread_count);
}
}
} else {
println!("All threads have shutdown (good).");
}
}
#[link_section = "__TEXT,__info_plist"]
#[no_mangle]
pub static INFO_PLIST: [u8; 619] = *include_bytes!("Info.plist");
#[link(name = "count_threads")]
extern "C" {
fn macos_count_running_threads() -> i32;
}