Now with Atomicity
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
extern crate rustijvm;
|
||||
|
||||
use std::fs::File;
|
||||
use std::rc::Rc;
|
||||
use std::sync::Mutex;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::io::{Cursor, Seek, SeekFrom, Read};
|
||||
|
||||
fn run_bfi(file: &str) -> String {
|
||||
let file = File::open(file).expect("Missing bf file");
|
||||
let rc = Rc::new(Mutex::new(Cursor::new(Vec::new())));
|
||||
let rc = Arc::new(Mutex::new(Cursor::new(Vec::new())));
|
||||
let mut machine = rustijvm::Machine::new_from_file("files/bonus/bfi.ijvm").unwrap();
|
||||
machine.set_output(rc.clone());
|
||||
machine.set_input(Box::new(file));
|
||||
|
||||
Reference in New Issue
Block a user