pike.git
/
src
/
testsuite.in
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/testsuite.in:5053:
return tmp; ]],10000) dnl this will crash pike on out-of-address-space-related errors dnl test_any([[ catch { allocate(10000,thread_create)(lambda() { sleep(1); })->wait(); } ]]) test_any([[ // Test that a loop relinquishes the interpreter lock every now and then. int count, stop, fail; Thread.thread_create (lambda() {
-
int
stop
_
time
= time()
+
1;
+
int
t
_
start
= time()
;
+
// Note: We need sub-second precision.
+
float stop_time = 1.0
+
time(t_start)
;
while (!stop) { count++;
-
if (time() > stop_time) {
+
if (time(
t_start
) > stop_time) {
fail = 1; break; } } }); sleep (0.1); stop = 1; sleep (0.1); return fail ? -1 : count > 0; ]], 1)