Changeset - 6bad006318e5
[Not reviewed]
default
0 1 0
NEO - 16 years ago 2009-09-23 14:53:11

-find_jobframe() now updates prev_frame_status when a jobframe is assigned
-find_jobframe() now starts scanning on the jobframe after prev_frame_index
1 file changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -298,20 +298,21 @@ int find_jobframe(struct distrenjob *hea
 
  struct distrenjob *distrenjob_ptr;
 

	
 
  your_job_type = 0;
 
  found = 0;
 
  /* iterate through jobs from first to last */
 
  for(distrenjob_ptr = head->next; (!found && !distrenjob_ptr) && !distrenjob_ptr->hibernate; distrenjob_ptr = distrenjob_ptr->next)
 
    for(frame_counter = distrenjob_ptr->prev_frame_index; !found && frame_counter < distrenjob_ptr->total_frames; frame_counter ++)
 
      if(distrenjob_ptr->frameset[frame_counter].status == FRAMESETSTATUS_UNASSIGNED)
 
    for(frame_counter = (distrenjob_ptr->prev_frame_index + 1); !found && frame_counter < distrenjob_ptr->total_frames; frame_counter ++)
 
      if(distrenjob_ptr->frameset[frame_counter].status == FRAMESETSTATUS_UNASSIGNED) // jobframe found
 
	{
 
	  found = 1;
 
	  your_job_type = distrenjob_ptr->type;
 
	  distrenjob_ptr->frameset[frame_counter].status = FRAMESETSTATUS_ASSIGNED;
 
	  distrenjob_ptr->frameset[frame_counter].start_time = clock();
 
	  distrenjob_ptr->assigned_frames++;
 
	  distrenjob_ptr->prev_frame_index = frame_counter;
 
	}
 

	
 
  if(!found)
 
    {
 
      fprintf(stderr, "No more jobs to render\n");
 
      sleep(1); /*< @todo eliminate the need for this line*/
0 comments (0 inline, 0 general)