ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/raypcalls.c
(Generate patch)

Comparing ray/src/rt/raypcalls.c (file contents):
Revision 2.14 by greg, Wed Dec 21 17:36:06 2005 UTC vs.
Revision 2.16 by greg, Sat Sep 15 02:47:56 2007 UTC

# Line 308 | Line 308 | ray_presult(           /* check for a completed ray */
308                  n = ray_pnprocs - ray_pnidle;
309          if (n <= 0)                     /* return if nothing to await */
310                  return(0);
311 +        if (!poll && ray_pnprocs == 1)  /* one process -> skip select() */
312 +                FD_SET(r_proc[0].fd_recv, &readset);
313 +
314   getready:                               /* any children waiting for us? */
315          for (pn = ray_pnprocs; pn--; )
316                  if (FD_ISSET(r_proc[pn].fd_recv, &readset) ||
# Line 396 | Line 399 | ray_pchild(    /* process rays (never returns) */
399   {
400          int     n;
401          register int    i;
402 +                                        /* flag child process for quit() */
403 +        ray_pnprocs = -1;
404                                          /* read each ray request set */
405          while ((n = read(fd_in, (char *)r_queue, sizeof(r_queue))) > 0) {
406                  int     n2;
# Line 519 | Line 524 | void
524   quit(ec)                        /* make sure exit is called */
525   int     ec;
526   {
527 +        if (ray_pnprocs > 0)    /* close children if any */
528 +                ray_pclose(0);          
529          exit(ec);
530   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines