(&self, _from_id: usize, input: D)
| 557 | } |
| 558 | |
| 559 | pub fn add_for_main(&self, _from_id: usize, input: D) -> u64 { |
| 560 | let id = GLOBAL_ID.fetch_add(1, std::sync::atomic::Ordering::AcqRel); |
| 561 | self.new[0].lock().unwrap().push((id, Arc::new(input))); |
| 562 | id |
| 563 | } |
| 564 | |
| 565 | pub fn take_all(&self, id: usize) -> Vec<(u64, Arc<D>)> { |
| 566 | self.new[id].lock().unwrap().drain(..).collect() |