Branch: Tag:

2015-04-21

2015-04-21 17:49:40 by Arne Goedeke <el@laramies.com>

Thread.Farm: pass exceptions to provide_error

In case an exception was thrown, the value of err ended up being
the Result object, while the error got lost.

518: Inside #if constant(thread_create)
   {    mixed res, err;    int st = gethrtime(); -  if( err = catch(res = q[1][0]( @q[1][1] )) && q[0]) +  +  err = catch(res = q[1][0]( @q[1][1] )); +  +  if( q[0] ) +  { +  if( err )    ([object]q[0])->provide_error( err ); -  else if( q[0] ) +  else    ([object]q[0])->provide( res ); -  +  }    object lock = mutex->lock();    free_threads += ({ this });    lock = 0;