| 464 | } |
| 465 | |
| 466 | static void Delete(int number) |
| 467 | { |
| 468 | gMutex.lock(); |
| 469 | |
| 470 | if (gBreakpoints->HasBreakpoint(number)) { |
| 471 | // Replace mBreakpoints with a copy and remove the breakpoint |
| 472 | // from it |
| 473 | Breakpoints *newBreakpoints = new Breakpoints(gBreakpoints, number); |
| 474 | Breakpoints *toRelease = gBreakpoints; |
| 475 | gBreakpoints = newBreakpoints; |
| 476 | |
| 477 | // Write memory barrier ensures that newBreakpoints values are |
| 478 | // updated before gBreakpoints is assigned to it |
| 479 | write_memory_barrier(); |
| 480 | |
| 481 | // Only release after gBreakpoints is set |
| 482 | toRelease->RemoveRef(); |
| 483 | |
| 484 | |
| 485 | if (gBreakpoints->IsEmpty()) { |
| 486 | // Don't need a write memory barrier here, it's harmless to |
| 487 | // see gShouldCallHandleBreakpoints update before gStepType |
| 488 | // has updated |
| 489 | gShouldCallHandleBreakpoints = (gStepType != STEP_NONE) || (sExecutionTrace==exeTraceLines); |
| 490 | } |
| 491 | } |
| 492 | |
| 493 | gMutex.unlock(); |
| 494 | } |
| 495 | |
| 496 | static void BreakNow(bool wait) |
| 497 | { |
nothing calls this directly
no test coverage detected