189 |
|
{ |
190 |
|
int nc, n, nw, i, sfirst; |
191 |
|
|
192 |
< |
if ((ray_pnidle <= 0 | r_send_next <= 0)) |
192 |
> |
if ((ray_pnidle <= 0) | (r_send_next <= 0)) |
193 |
|
return(0); /* nothing we can send */ |
194 |
|
|
195 |
|
sfirst = 0; /* divvy up labor */ |
229 |
|
if (sendq_full() && ray_pflush() <= 0) |
230 |
|
error(INTERNAL, "ray_pflush failed in ray_psend"); |
231 |
|
|
232 |
< |
copystruct(&r_queue[r_send_next], r); |
232 |
> |
r_queue[r_send_next] = *r; |
233 |
|
r_send_next++; |
234 |
|
} |
235 |
|
|
244 |
|
if (sendq_full()) { |
245 |
|
RAY mySend; |
246 |
|
int rval; |
247 |
< |
copystruct(&mySend, r); |
247 |
> |
mySend = *r; |
248 |
|
/* wait for a result */ |
249 |
|
rval = ray_presult(r, 0); |
250 |
|
/* put new ray in queue */ |
251 |
< |
copystruct(&r_queue[r_send_next], &mySend); |
251 |
> |
r_queue[r_send_next] = mySend; |
252 |
|
r_send_next++; |
253 |
|
return(rval); /* done */ |
254 |
|
} |
255 |
|
/* add ray to send queue */ |
256 |
< |
copystruct(&r_queue[r_send_next], r); |
256 |
> |
r_queue[r_send_next] = *r; |
257 |
|
r_send_next++; |
258 |
|
/* check for returned ray... */ |
259 |
|
if (r_recv_first >= r_recv_next) |
260 |
|
return(0); |
261 |
|
/* ...one is sitting in queue */ |
262 |
< |
copystruct(r, &r_queue[r_recv_first]); |
262 |
> |
*r = r_queue[r_recv_first]; |
263 |
|
r_recv_first++; |
264 |
|
return(1); |
265 |
|
} |
279 |
|
return(0); |
280 |
|
/* check queued results first */ |
281 |
|
if (r_recv_first < r_recv_next) { |
282 |
< |
copystruct(r, &r_queue[r_recv_first]); |
282 |
> |
*r = r_queue[r_recv_first]; |
283 |
|
r_recv_first++; |
284 |
|
return(1); |
285 |
|
} |
354 |
|
rp->slights = NULL; |
355 |
|
} |
356 |
|
/* return first ray received */ |
357 |
< |
copystruct(r, &r_queue[r_recv_first]); |
357 |
> |
*r = r_queue[r_recv_first]; |
358 |
|
r_recv_first++; |
359 |
|
return(1); |
360 |
|
} |
469 |
|
return; |
470 |
|
inclose++; |
471 |
|
/* check argument */ |
472 |
< |
if ((nsub <= 0 | nsub > ray_pnprocs)) |
472 |
> |
if ((nsub <= 0) | (nsub > ray_pnprocs)) |
473 |
|
nsub = ray_pnprocs; |
474 |
|
/* clear our ray queue */ |
475 |
|
while (ray_presult(&res,0) > 0) |