I have a problem. When I run my program (which contains this), through gdb, I can see that burstTime does have a value ( such as 1, 3, 15, etc).
* Instruction_t - stores a specific instruction
* action - CPU or IO
* burstTime - the time taken in the instruction.
static void loadInstruction( Action_t actionType, int burstTime, PA_t *pa)
instruction = (Instruction_t *)malloc( sizeof( Instruction_t));
instruction->action = actionType;
instruction->burstTime = burstTime;
insertLastElement( pa->instructions, (void *)instruction);
/* Here pa->instructions is a Linked List, and insertLastElement is defined elsewhere. */
But when I dequeue from my list, instruction->burstTime suddenly equals zero!
Is there something I'm not understanding? Or isn't it anything to do with this part of the code?