This commit is contained in:
azw 2024-05-09 22:02:13 +08:00
parent 3a2b95dfc9
commit cbca2a666f

View File

@ -1,6 +1,8 @@
use std::rc::{Rc, Weak}; use std::rc::{Rc, Weak};
use std::cell::RefCell; use std::cell::RefCell;
use std::sync::Mutex; use std::sync::Mutex;
use std::thread;
use std::thread::Thread;
use r9_macro::SharedFromSelf; use r9_macro::SharedFromSelf;
use r9_macro_derive::SharedFromSelf; use r9_macro_derive::SharedFromSelf;
@ -24,6 +26,7 @@ impl<T> Queue<T> {
} }
pub fn push(&self, node: &Rc::<RefCell::<crate::ListHead<T>>>) { pub fn push(&self, node: &Rc::<RefCell::<crate::ListHead<T>>>) {
println!("Child thread ID is: {:?}", thread::current().id());
crate::ListHead::<T>::add_tail(&self.msg_list.lock().unwrap(), node); crate::ListHead::<T>::add_tail(&self.msg_list.lock().unwrap(), node);
} }