Menu

The most common mistake made by developers using threadpool is to leave a worker thread in a dirty state after executing a callback function.

The application verifier helps detect these subtle errors, and helps in the development of a robust application.

The verifier hooks into all threadpool APIs that execute a callback (Work, Timer, Wait and I/O). It then substitutes its own contexts and parameter while encapsulating the users original data. The callback is then executed using the original context and parameters. The Verifier then compares the thread state before and after and generates warning and error messages if it differs.

The following state is checked for changes.

  • Thread priority

  • Thread affinity

  • Orphaned critical sections

  • Unclosed window resource

  • Unprocessed messages in queue (window messages, etc)

The Application Verifier also checks for API misuse.

Following is a list of verifier stops that may occur when running the threadpool checks against a solution or project on different platforms:

Error message

Stop code

The priority of this threadpool thread has been changed

700

The affinity of this threadpool thread has been changed

701

Unprocessed msg in the msg pool of current thread

702

Unclosed window belonged to the current thread

703

ExitThread() called on a threadpool thread

704

Thread is in impersonation state when it's returned to a threadpool thread.

705

The parameters for the timer object are inconsistent

709

A function which requires persistent thread is called within the callback

706

Thread is in dirty transaction state

707

This threadpool state has unbalanced CoInit and CoUnInit calls

708

The loader lock has been held by the threadpool thread within the callback .

70A

The preferred language is set by the threadpool thread within the callback.

70B

The background priority is set by the threadpool thread within the callback.

70C

TerminateThread() called on a threadpool thread

70D

Properties

One property is available for the Threadpool tests and that is to turn on the AsynchCheck. This will check asynchronous calls that require a persistent thread. The default is turned off. To turn it on, change the Boolean from false to true.