Skip to content

Commit 76713d6

Browse files
committed
fix: update usertest cases and workflow.yml
1 parent 078d372 commit 76713d6

10 files changed

Lines changed: 16 additions & 16 deletions

File tree

.github/workflows/workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,5 @@ jobs:
7171
7272
- name: Run exercise in QEMU and check output (ch${{ matrix.ch }})
7373
run: |
74-
timeout 3m cargo qemu --ch ${{ matrix.ch }} --exercise --nobios --ci 2>&1 \
74+
timeout 6m cargo qemu --ch ${{ matrix.ch }} --exercise --nobios --ci 2>&1 \
7575
| python3 checker/check/ch${{ matrix.ch }}.py

user/src/bin/ch8_deadlock_sem1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ extern "C" fn main() -> i32 {
9494
let mut tids = [0usize; THREAD_N];
9595

9696
for i in 0..THREAD_N {
97-
tids[i] = thread_create(deadlock_test as usize, 0) as usize;
97+
tids[i] = thread_create(deadlock_test as *const () as usize, 0) as usize;
9898
}
9999

100100
sleep(500);

user/src/bin/ch8_deadlock_sem2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ extern "C" fn main() -> i32 {
5454
let mut tids = [0usize; THREAD_N];
5555

5656
for i in 0..THREAD_N {
57-
tids[i] = thread_create(deadlock_test as usize, i) as usize;
57+
tids[i] = thread_create(deadlock_test as *const () as usize, i) as usize;
5858
}
5959

6060
sleep(1000);

user/src/bin/mpsc_sem.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ pub extern "C" fn main() -> i32 {
5959
let mut threads = Vec::new();
6060
for i in 0..PRODUCER_COUNT {
6161
threads.push(thread_create(
62-
producer as usize,
62+
producer as *const () as usize,
6363
&ids.as_slice()[i] as *const _ as usize,
6464
));
6565
}
66-
threads.push(thread_create(consumer as usize, 0));
66+
threads.push(thread_create(consumer as *const () as usize, 0));
6767
// wait for all threads to complete
6868
for thread in threads.iter() {
6969
waittid(*thread as usize);

user/src/bin/phil_din_mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub extern "C" fn main() -> i32 {
7272
for i in 0..N {
7373
assert_eq!(mutex_create(true), i as isize);
7474
v.push(thread_create(
75-
philosopher_dining_problem as usize,
75+
philosopher_dining_problem as *const () as usize,
7676
&ids.as_slice()[i] as *const _ as usize,
7777
));
7878
}

user/src/bin/race_adder_mutex_blocking.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub extern "C" fn main() -> i32 {
3636
assert_eq!(mutex_create(true), 0);
3737
let mut v = Vec::new();
3838
for _ in 0..THREAD_COUNT {
39-
v.push(thread_create(f as usize, 0) as usize);
39+
v.push(thread_create(f as *const () as usize, 0) as usize);
4040
}
4141
let mut time_cost = Vec::new();
4242
for tid in v.iter() {

user/src/bin/sync_sem.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ pub extern "C" fn main() -> i32 {
3333
assert_eq!(semaphore_create(0) as usize, SEM_SYNC);
3434
// create threads
3535
let threads = vec![
36-
thread_create(first as usize, 0),
37-
thread_create(second as usize, 0),
36+
thread_create(first as *const () as usize, 0),
37+
thread_create(second as *const () as usize, 0),
3838
];
3939
// wait for all threads to complete
4040
for thread in threads.iter() {

user/src/bin/test_condvar.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ pub extern "C" fn main() -> i32 {
4949
assert_eq!(mutex_create(true) as usize, MUTEX_ID);
5050
// create threads
5151
let threads = vec![
52-
thread_create(first as usize, 0),
53-
thread_create(second as usize, 0),
52+
thread_create(first as *const () as usize, 0),
53+
thread_create(second as *const () as usize, 0),
5454
];
5555
// wait for all threads to complete
5656
for thread in threads.iter() {

user/src/bin/threads.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ pub fn thread_c() -> isize {
3232
#[no_mangle]
3333
pub extern "C" fn main() -> i32 {
3434
let mut v = vec![
35-
thread_create(thread_a as usize, 0),
36-
thread_create(thread_b as usize, 0),
37-
thread_create(thread_c as usize, 0),
35+
thread_create(thread_a as *const () as usize, 0),
36+
thread_create(thread_b as *const () as usize, 0),
37+
thread_create(thread_c as *const () as usize, 0),
3838
];
3939
println!("v :{:?}", v);
4040
let max_len = 5;
4141
for i in 0..max_len {
4242
println!("create tid: {}", i + 4);
43-
let tid = thread_create(thread_b as usize, 0);
43+
let tid = thread_create(thread_b as *const () as usize, 0);
4444
println!("create tid: {} end", i + 4);
4545
v.push(tid);
4646
}

user/src/bin/threads_arg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub extern "C" fn main() -> i32 {
3131
];
3232
for arg in args.iter() {
3333
v.push(thread_create(
34-
thread_print as usize,
34+
thread_print as *const () as usize,
3535
arg as *const _ as usize,
3636
));
3737
}

0 commit comments

Comments
 (0)