# HG changeset patch # User NEO # Date 2009-09-23 14:53:11 # Node ID 6bad006318e5d00dd6e35e3560e95caeae7da9bb # Parent 0072103d825f8a1720f37c7d2b02ed2def750f88 -find_jobframe() now updates prev_frame_status when a jobframe is assigned -find_jobframe() now starts scanning on the jobframe after prev_frame_index diff --git a/src/server/distrend.c b/src/server/distrend.c --- a/src/server/distrend.c +++ b/src/server/distrend.c @@ -301,14 +301,15 @@ int find_jobframe(struct distrenjob *hea 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)