(workers: usize)
| 541 | |
| 542 | impl<D> GlobalQueue<D> { |
| 543 | pub fn init(workers: usize) -> Self { |
| 544 | let new = (0..workers).map(|_| Default::default()).collect(); |
| 545 | Self { new } |
| 546 | } |
| 547 | |
| 548 | pub fn add_new(&self, from_id: usize, input: D) -> u64 { |
| 549 | let id = GLOBAL_ID.fetch_add(1, std::sync::atomic::Ordering::AcqRel); |