pike.git/
src/
testsuite.in
Branch:
Tag:
Non-build tags
All tags
No tags
2010-10-30
2010-10-30 17:49:44 by Martin Stjernholm <mast@lysator.liu.se>
e9a547c090d5898824da6a19165ea897d581ea11 (
16
lines) (+
13
/-
3
)
[
Show
|
Annotate
]
Branch:
7.9
Fixed the yield test to end more quickly when it fails.
5011:
test_any([[ // Test that a loop relinquishes the interpreter lock every now and then.
-
int count, stop;
-
Thread.thread_create (lambda()
{while
(!stop) count++;});
+
int count, stop
, fail
;
+
Thread.thread_create (lambda()
{
+
int stop_time = time
(
) + 1;
+
while (
!stop)
{
+
count++;
+
if (time() > stop_time) {
+
fail = 1;
+
break;
+
}
+
}
+
}
);
sleep (0.1); stop = 1; sleep (0.1);
-
return count > 0;
+
return
fail ? -1 :
count > 0;
]], 1) // _disable_threads