parent
7daf146801
commit
44af4f4f52
5 changed files with 12 additions and 11 deletions
|
|
@ -577,9 +577,9 @@ impl EventLoopWaker {
|
|||
fn new(rl: CFRunLoopRef) -> EventLoopWaker {
|
||||
extern "C" fn wakeup_main_loop(_timer: CFRunLoopTimerRef, _info: *mut c_void) {}
|
||||
unsafe {
|
||||
// create a timer with a 1microsec interval (1ns does not work) to mimic polling.
|
||||
// it is initially setup with a first fire time really far into the
|
||||
// future, but that gets changed to fire immediatley in did_finish_launching
|
||||
// Create a timer with a 0.1µs interval (1ns does not work) to mimic polling.
|
||||
// It is initially setup with a first fire time really far into the
|
||||
// future, but that gets changed to fire immediately in did_finish_launching
|
||||
let timer = CFRunLoopTimerCreate(
|
||||
ptr::null_mut(),
|
||||
std::f64::MAX,
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ impl<T> Drop for EventLoopProxy<T> {
|
|||
impl<T> EventLoopProxy<T> {
|
||||
fn new(sender: Sender<T>) -> EventLoopProxy<T> {
|
||||
unsafe {
|
||||
// just wakeup the eventloop
|
||||
// just wake up the eventloop
|
||||
extern "C" fn event_loop_proxy_handler(_: *mut c_void) {}
|
||||
|
||||
// adding a Source to the main CFRunLoop lets us wake it up and
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ unsafe impl<T> Sync for Proxy<T> {}
|
|||
impl<T> Proxy<T> {
|
||||
fn new(sender: mpsc::Sender<T>) -> Self {
|
||||
unsafe {
|
||||
// just wakeup the eventloop
|
||||
// just wake up the eventloop
|
||||
extern "C" fn event_loop_proxy_handler(_: *mut c_void) {}
|
||||
|
||||
// adding a Source to the main CFRunLoop lets us wake it up and
|
||||
|
|
|
|||
|
|
@ -204,9 +204,9 @@ impl Default for EventLoopWaker {
|
|||
fn default() -> EventLoopWaker {
|
||||
extern "C" fn wakeup_main_loop(_timer: CFRunLoopTimerRef, _info: *mut c_void) {}
|
||||
unsafe {
|
||||
// create a timer with a 1µs interval (1ns does not work) to mimic polling.
|
||||
// it is initially setup with a first fire time really far into the
|
||||
// future, but that gets changed to fire immediatley in did_finish_launching
|
||||
// Create a timer with a 0.1µs interval (1ns does not work) to mimic polling.
|
||||
// It is initially setup with a first fire time really far into the
|
||||
// future, but that gets changed to fire immediately in did_finish_launching
|
||||
let timer = CFRunLoopTimerCreate(
|
||||
ptr::null_mut(),
|
||||
std::f64::MAX,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue