static internal unsafe void AddProcessorContext(ProcessorContext *context) { // Add processor to list of processors in MP system. Careful // to avoid adding processor mid-freeze or without lock. start: freezeLock.Acquire(); try { if (FreezeRequested) { goto start; } ProcessorContext *head = Processor.processorTable[0].context; context->nextProcessorContext = head->nextProcessorContext; head->nextProcessorContext = context; context->ipiFreeze = Running; // From this point on the processor is visible // in the debugger DebugStub.AddProcessor(context->cpuRecord.id); } finally { freezeLock.Release(); } }