Skip to content

Commit fd6a201

Browse files
committed
Update for CodeFreeze 2016
1 parent 5c392d3 commit fd6a201

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

burn/burn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
int triple(int x);
99
""")
1010

11-
C = ffi.dlopen("target/debug/libburn-c21ba537b4f26cae.dylib")
11+
C = ffi.dlopen("target/debug/libburn.dylib")
1212

1313
print(C.triple(3))

burn/src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use std::thread;
33
#[no_mangle]
44
pub extern fn triple(x: i32) -> i32 {
55

6-
let _: Vec<_> = (0..10).map(|i| {
7-
thread::scoped(move || {
6+
let handles: Vec<_> = (0..10).map(|i| {
7+
thread::spawn(move || {
88
println!("Thread {} running", i);
99

1010
let mut x = 0;
@@ -16,6 +16,10 @@ pub extern fn triple(x: i32) -> i32 {
1616
})
1717
}).collect();
1818

19+
for h in handles {
20+
h.join().unwrap();
21+
}
22+
1923
x * 3
2024
}
2125

calc/calc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
ffi.cdef("""
88
int calculate(const char *script);
99
""")
10-
C = ffi.dlopen("target/release/libcalc-771b1f816b5bd78c.dylib")
10+
C = ffi.dlopen("target/release/libcalc.dylib")
1111

1212
def main():
1313
result = C.calculate(b"+ * * + * - /")

double/double.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
int double(int);
88
""")
99

10-
C = ffi.dlopen("target/release/libdouble-8612fd65af997c10.dylib")
10+
C = ffi.dlopen("target/release/libdouble.dylib")
1111

12-
print(C.double(3))
12+
print(C.double(9))

0 commit comments

Comments
 (0)