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

Comparing ray/src/common/bsdf_m.c (file contents):
Revision 3.32 by greg, Wed Apr 8 02:41:02 2015 UTC vs.
Revision 3.34 by greg, Sun Aug 23 00:56:00 2015 UTC

# Line 151 | Line 151 | fo_getvec(FVECT v, double ndxr, void *p)
151          for (li = 0; ndx >= ab->lat[li].nphis; li++)
152                  ndx -= ab->lat[li].nphis;
153          SDmultiSamp(rx, 2, randX);
154 <        d = (1. - randX)*sq(cos(M_PI/180.*ab->lat[li].tmin)) +
155 <                randX*sq(cos(M_PI/180.*ab->lat[li+1].tmin));
154 >        d = (1. - rx[0])*sq(cos(M_PI/180.*ab->lat[li].tmin)) +
155 >                rx[0]*sq(cos(M_PI/180.*ab->lat[li+1].tmin));
156          v[2] = d = sqrt(d);     /* cos(pol) */
157          azi = 2.*M_PI*(ndx + rx[1] - .5)/ab->lat[li].nphis;
158          d = sqrt(1. - d*d);     /* sin(pol) */
# Line 849 | Line 849 | SDgetMtxCDist(const FVECT inVec, SDComponent *sdc)
849                  reverse = 1;
850          }
851          cdlast = NULL;                  /* check for it in cache list */
852 +        /* PLACE MUTEX LOCK HERE FOR THREAD-SAFE */
853          for (cd = (SDMatCDst *)sdc->cdList; cd != NULL;
854                                          cdlast = cd, cd = cd->next)
855                  if (cd->indx == myCD.indx && (cd->calen == myCD.calen) &
# Line 872 | Line 873 | SDgetMtxCDist(const FVECT inVec, SDComponent *sdc)
873                  cd->next = (SDMatCDst *)sdc->cdList;
874                  sdc->cdList = (SDCDst *)cd;
875          }
876 +        /* END MUTEX LOCK */
877          return (SDCDst *)cd;            /* ready to go */
878   }
879  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines