Beispiel #1
0
void syncronize(long time)
{
    //scheduling();
    int a=0;
    //printf("%d ,,,    %d\n\n", row[0].jobend, time);
    for(a=0; a<4; a++)
    {
           if(row[a].jsize==0 && row[a].jobend <= time)
           {
               row[a].busy = 0; // job can be done in time
           }
           else if(row[a].jsize!=0 && row[a].jobend <= time)
           {
               row[a].busy = 0; // then it ends first stored job, but some jobs remain
               while(1)
                {
                    row[a].rq->time = row[a].jobend;
                    int nexttime = access(row[a].rq,a);
                    deletequeue(a);
                   // row[a].jobend += nexttime;
                    if(row[a].jobend > time)
                    {
                        row[a].busy = 1;
                        break;
                    }
                    else
                    {
                        row[a].busy = 0;
                    }
                    if(row[a].jsize==0 && row[a].jobend <= time)
                    {
                        row[a].busy = 0;
                        break;
                    }
                }
            }
            else //then the job should be running in current time.
            {
                row[a].busy = 1;
            }

     }
}
Beispiel #2
0
/*
deletes a message queue 
*/ 
void deletemsgqueue(MessageQue *pMsgQue)
{
	deletequeue(pMsgQue->pQueue);
	free(pMsgQue);
	return;
}