The deadlock and potential deadlock settings allow Thread Validator to regularly scan for various error conditions using the same data collected by the options on the Collect tab.
If your application has many threads, you may prefer to disable these options to prevent Thread Validator from using too much processor time.
However, at run time you can force Thread Validator to check for deadlocks or potential deadlocks in the application under test.
If potential deadlock detection is on but the detection interval is set to a long time or to Never, you may wish to manually trigger a potential deadlock check:
This menu option will only be enabled if the Potential Deadlocks option on the Detect settings tab is enabled.
The example application can be used to demonstrate the deadlock checking:
1. Turn on the Potential Deadlocks option on the Detect settings tab
2. Set the Deadlock detect interval to Never (on the same setting page)
3. Launch the example application.
4. Use some of the built in tests to create a potential deadlock, for example the Potential deadlocks 2 thread.
5. Notice that Thread Validator does not register the potential deadlocks including for example, in the following three displays.
In the Errors panel of the Summary tab:
In the snapshots view of the Threads tab
Or in the All Locks tab:
6. Force a potential deadlock check as described above, and each of these displays will update to show the potential deadlocks found
In the Errors panel of the Summary tab, where the pink bar indicates 2 potential deadlocks:
In the snapshots view of the Threads tab, where the thread snapshots now starts to register the threads as having potential deadlocks (pink )
Or in the All Locks tab, where the locked threads are also now highlighted in pink: