Branch: Tag:

2004-05-01

2004-05-01 12:33:38 by Martin Stjernholm <mast@lysator.liu.se>

Fixed compat for strange MutexKey destruct behavior in <= 7.4.

Rev: lib/7.4/modules/Thread.pmod:1.1
Rev: lib/modules/testsuite.in:1.28
Rev: src/program_id.h:1.20
Rev: src/threads.c:1.236

1: - dnl $Id: testsuite.in,v 1.27 2004/04/21 19:27:53 mast Exp $ + dnl $Id: testsuite.in,v 1.28 2004/05/01 12:31:35 mast Exp $      dnl - Array   
810:    Thread.Mutex m = Thread.Mutex();    Thread.MutexKey l = m->lock();    -  void thread_fn () +  void thread_fn()    {    m->lock();    num_ok++;
820:       sleep (0.5); // Make sure they are waiting for the lock.    destruct (m); +  l = 0;    sleep (0.5); // Wait for them to finish.       return num_ok;    ]], 5) -  +  +  test_any([[ +  #pike 7.4 +  int num_ok = 0; +  +  Thread.Mutex m = Thread.Mutex(); +  Thread.MutexKey l = m->lock(); +  +  void thread_fn() +  { +  m->lock(); +  num_ok++; +  }; +  +  array(Thread.Thread) t = (({Thread.thread_create}) * 5) (thread_fn); +  +  sleep (0.5); // Make sure they are waiting for the lock. +  destruct (m); // Destructs the outstanding lock too. +  sleep (0.5); // Wait for them to finish. +  +  return num_ok; +  ]], 5)   ]])      dnl - This test is disabled for now.