void unblock(int pid){ if(isBlockedListNull){ return ; } unblockProcess(pid); }
/** * @brief Function creates a thread * * @details Function creates a thread according its cycle time, then * unblock the process * * @pre void* argument contains argument * * @post thread run for its time * * @return None * */ void* thread_perform( void* argument ) { struct pcb_table* temp; // temp argument int time = 0; // init. time temp = ( ( struct pcb_table * ) argument ); // calculate running time time = calcTime( *( temp->current ), *temp ); // delay that long time delay( ( clock_t ) time ); // print log clock_gettime( CLOCK_REALTIME, &endTime ); totalTime = timeLap( startTime, endTime ); interruptLog( temp->current, logComment ); recordLog( &logList, ¤tLog, totalTime, logComment ); if( toMonitor ) printLog( currentLog ); // unblock process unblockProcess(temp->processNum); } // end of func