1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

all: promote value type function arguments to heap if necessary (#10528)

This commit is contained in:
Uwe Krüger
2021-06-20 17:40:24 +02:00
committed by GitHub
parent 6c8182cc25
commit f32a76b268
8 changed files with 130 additions and 35 deletions

View File

@@ -6,7 +6,8 @@ mut:
}
const (
sleep_time = time.millisecond * 50
run_time = time.millisecond * 200 // must be big enough to ensure threads have started
sleep_time = time.millisecond * 250 // some tolerance added
)
fn test_return_lock() {
@@ -16,12 +17,12 @@ fn test_return_lock() {
go fn (shared s AA, start time.Time) {
for {
reader(shared s)
if time.now() - start > sleep_time {
if time.now() - start > run_time {
exit(0)
}
}
}(shared s, start)
time.sleep(sleep_time * 2)
time.sleep(sleep_time)
assert false
}
@@ -30,7 +31,7 @@ fn printer(shared s AA, start time.Time) {
lock s {
assert s.b in ['0', '1', '2', '3', '4', '5']
}
if time.now() - start > time.millisecond * 50 {
if time.now() - start > run_time {
exit(0)
}
}