New implementation with threads per component
This commit is contained in:
parent
ac8ebbafe9
commit
bfbddda58c
15 changed files with 170 additions and 265 deletions
12
src/connection.rs
Normal file
12
src/connection.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
use std::sync::Arc;
|
||||
use crate::pin::Pin;
|
||||
|
||||
pub fn connect_pins(source: &Arc<Pin>, destination: &Arc<Pin>) -> Result<(), String> {
|
||||
let mut source_connections = source.connections.lock().unwrap();
|
||||
source_connections.push(destination.clone());
|
||||
|
||||
let mut dest_connections = destination.connections.lock().unwrap();
|
||||
dest_connections.push(source.clone());
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue