daily pastebin goal
9%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fn add_new_uielement6_instance(graph: &Arc<RwLock<Graph>>) {
  2.     let graph: &Graph = &*graph.read().unwrap();
  3.     let uielement2_set = &mut *graph.uielement2.lock().unwrap();
  4.     let uielement6_set = &mut *graph.uielement6.lock().unwrap();
  5.     let uielement11_set = &mut *graph.uielement11.lock().unwrap();
  6.     uielement6_set.idx += 1;
  7.  
  8.     let (uielement6_sender, uielement6_receiver): (Sender<Coordinate>, Receiver<Coordinate>) = channel();
  9.     let uielement6_instance: Arc<Mutex<XAndYPositiveInstance>> = Arc::new(Mutex::new(XAndYPositiveInstance {
  10.         instance_id: uielement6_set.idx,
  11.         incoming_port: IncomingPort { receiver: uielement6_receiver },
  12.         instance_storage: None
  13.     }));
  14.  
  15.     for (instanceid, instance_mutex) in &uielement2_set.instances {
  16.         let instance: &mut SourceNode = &mut *instance_mutex.lock().unwrap();
  17.         let instance: &mut NumberSourceInstance = instance.as_any().downcast_mut::<&mut NumberSourceInstance>().unwrap();
  18.         instance.port_uielement8.successors[0].senders.push(uielement6_sender.clone())
  19.     }
  20. }
RAW Paste Data
Top