Deleting a locked critical section

This tutorial demonstrates Thread Validator detecting your application incorrectly deleting a critical section that is still in use (locked).

Note that for your executing nativeExample your critical section addresses, thread Ids and sequence numbers will all be different. We have used the values that we experienced to write this tutorial. Substitute your own values where appropriate.

  • Launch the sample application. Click on the re-launch icon on the toolbar.
    Thread Validator relaunch icon
  • The previously launched application is started.
  • From the Test menu, choose the Delete still active critical section.
  • Viewing the Locks tab will show one critical section in dark purple. This indicates the critical sections has a thread error.
    Thread Validator delete locked critical section
  • Viewing the Per Thread Locks tab will show all application threads, one of which will each have one critical section highlighted in dark purple. This indicates the critical section has a thread error.
    Thread Validator delete locked critical section
  • Viewing the Current Locks tab will show two threads. Any critical sections shown will not be coloured with any error colour as the critical section was exited incorrectly and thus is not locked or waiting.
    Thread Validator delete locked critical section
  • Using the Locks tab, right click on the dark purple entry and choose Information about lock/wait…. A modeless dialog containing information about the lock is displayed. The information includes some text describing the error.
    Thread Validator critical section information panel
  • Using the Per Thread Locks tab, right click on the dark purple entry and choose Show Callstack…. A modeless dialog containing the callstack for the lock is displayed.
    Thread Validator delete locked critical section callstack
  • Close the Application using the File menu’s Exit command.
  • The various tabs will display the last known state of the critical sections and waits prior to the application finishing.
  • Any errors identified during shutdown will be added to the state for each critical section and the displays updated to reflect this.

Fully functional, free for 30 days