Branch: Tag:

2010-10-30

2010-10-30 17:49:44 by Martin Stjernholm <mast@lysator.liu.se>

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