How to get Thread Lock Checker

Navigation: »No topics above this level«

How to get Thread Lock Checker

 Return to chapter overview

Thread Lock Checker is free for commercial use. Thread Lock Checker can be downloaded for Software Verify's website at https://www.softwareverify.com/product/thread-lock-checker/.

This help manual is available in Compiled HTML Help (Windows Help files), PDF, and online.

Windows Help | https://www.softwareverify.com/documentation/chm/threadLockChecker.chm
PDF | https://www.softwareverify.com/documentation/pdfs/threadLockChecker.pdf
Online | https://www.softwareverify.com/documentation/html/threadLockChecker/index.html

Whilst Thread Lock Checker is free for commercial use, Thread Lock Checker is copyrighted software and is not in the public domain.

You are free to use the software at your own risk.

You are not allowed to distribute the software in any form, or to sell the software, or to host the software on a website.

Contact

Contact Software Verify at:

Software Verify Limited

Suffolk Business Park

Eldo House

Kempson Way

Bury Saint Edmunds

IP32 7AR

United Kingdom

email | sales@softwareverify.com
web | https://www.softwareverify.com
blog | https://www.softwareverify.com/blog
twitter | http://twitter.com/softwareverify

Visit our blog to read our articles on debugging techniques and tools.

Follow us on twitter to keep track of the latest software tools and updates.


What does Thread Lock Checker do?

Navigation: »No topics above this level«

What does Thread Lock Checker do?

 Return to chapter overview

Thread Lock Checker scans your source code looking for common errors when locking critical sections. Before describing what Thread Lock Checker detects we will present a brief outline of how critical sections and locks can be used.

Note: For simplicity in this help file, we always use CSingleLock for the example lock type, even though Thread Lock Checker can detect many more lock types than that.

Critical Sections and locks

Critical sections are used to provide synchronised access to data so that only one part of a program can modify the data at a time an no one can read the data while it is being modified. To make the management of locking and unlocking critical sections easy Microsoft introduced the concept of the single lock and multi lock, represented by the CSingleLock and CMultiLock MFC classes. Other third party libraries also have similar constructs (we'll cover those later).

A really important and useful thing about using CSingleLock and CMultiLock to control locks on the stack is that if an exception is thrown the locks are automatically cleaned up by the exception handling chain and all locks are automatically released, preventing the likelihood of an exception causing a deadlock due to a lock being left locked during an exception handling sequence.

A feature of the CSingleLock and CMultiLock classes is that their constructor constructs the lock and by default initialises it to be unlocked. Class methods Lock() and Unlock() are provided to lock the object. If the object goes out of scope (or is deleted if it is on the heap) when it is locked, the object automatically unlocks itself.

Thus you could have several different ways of expressing the same concept:

1. Start with an unlocked lock, do some work, lock the lock, access protected code, unlock the lock, do some work

void doWork1()

{

CSingleLock        lock(&critSect);                // start unlocked

...

lock.Lock();

... // access protected resource

lock.Unlock();

...

}

2. Start with an unlocked lock on the heap, do some work, lock the lock, access protected code, unlock the lock, delete the lock, do some work

void doWork2()

{

CSingleLock        *lock;

lock = new CSingleLock(&critSect);                // start unlocked

...

lock.Lock();

... // access protected resource

lock->Unlock();

delete lock;

...

}

3. Start with an unlocked lock on the heap, do some work, lock the lock, access protected code, delete the lock (implicitly unlocking the lock), do some work

void doWork3()

{

CSingleLock        *lock;

lock = new CSingleLock(&critSect);                // start unlocked

...

lock.Lock();

... // access protected resource

delete lock;        // implicitly unlock the lock during the delete

...

}

4. do some work, create a local scope, create a locked lock, access protected code, leave local scope implicitly unlocking and destroying the lock, do some work

void doWork4()

{

...

{

CSingleLock        lock(&critSect, TRUE);                // start locked

... // access protected resource

// lock is unlocked at the end of the local scope

}

...

}

For the most part using CSingleLock and CMultilock with the locking parameter set to its default value (FALSE) is not very useful. This leaves you with a lock that by default is not locked and implies that you will be using the Lock() and Unlock() methods to manage if the lock is locked or unlocked.

The real value in the CSingleLock and CMultiLock classes is that you can pass TRUE to the constructor so that the lock is created in the locked state and just let the lock destruction unlock the lock implicitly. Using this method you can ensure that you never leave locks unlocked and never forget to lock a lock. This is demonstrated in doWork4() above.

Thread Lock Checker

Thread Lock Checker scans your source code looking for common errors when locking critical sections using classes like CSingleLock and CMultiLock.

There are four valid ways to initialise a CSingleLock object using its constructor:

CSingleLock        lock(&sect);                        // default unlocked

CSingleLock        lock(&sect, FALSE);                // unlocked

CSingleLock        lock(&sect, TRUE);                // locked

CSingleLock        lock(&sect, lockStatus);        // lockStatus decides if locked or not

Of the methods shown above, only one is guaranteed to lock and protect the resouce. The first two do not lock and protect the resource. The last method depends on the variable to lock and protect the resource. Thread Lock Checker detects all of these conditions. By default the locked state (3rd in the list above) is not reported for your attention.

There are also many invalid ways to initialise a CSingleLock object that will be accepted by the compiler.

The following is four examples of forgetting to specify the variable name. This results in a lock that is created then immediately destroyed. Even if it gets locked it will be destroyed (and thus unlocked) before it can be used to protect the critical resource.

CSingleLock(&sect);                        // default unlocked

CSingleLock(&sect, FALSE);                // unlocked

CSingleLock(&sect, TRUE);                // locked

CSingleLock(&sect, lockStatus);        // lockStatus decides if locked or not

Thread Lock Checker will report all four of these invalid ways of creating a CSingleLock for your attention.


Default Lock Types

Navigation: »No topics above this level«

Default Lock Types

 Return to chapter overview

The default settings will cause Thread Lock Checker to search for the following types:

Standard Library

std::unique_lock<std::mutex>

std::unique_guard<std::mutex>

MFC

CSingleLock

CMultiLock.

Qt

QMutexLocker

QReadLocker

QWriteLocker

ACE

ACE_Guard<ACE_Lock>

ACE_Guard<ACE_Adaptive_Lock>

ACE_Guard<ACE_Mutex>

MSJ/MSDN

COptexSingleLock

Software Verify

stubSingleLock

stubMultiLock

What if I've got my own lock types I need to check for?

If you've got your own lock types you can specify these using the settings dialog or the command line.


Menu

Navigation: »No topics above this level«

Menu

 Return to chapter overview

The main menu contains four menus, File, Edit, Software Updates and Help.


File

Navigation: Menu >

File

 Return to chapter overview

The File menu controls starting and stopping scans for thread lock errors, clearing the display and exiting the program.

File menu instructionStep Scan Directory... instructionStep displays a directory chooser then starts scanning that directory for thread locking errors.

File menu instructionStep Stop scan instructionStep stops any scan that is in progress

File menu instructionStep Clear Display instructionStep clear all results from a previous scan and to remove any source code from the source code editing window.

File menu instructionStep Exit instructionStep closes Thread Lock Checker


Edit

Navigation: Menu >

Edit

 Return to chapter overview

The Edit menu controls editing settings, loading settings and saving settings.

Edit menu instructionStep Settings... instructionStep displays the settings dialog.

Edit menu instructionStep Load Settings... instructionStep loads previously saved settings.

Edit menu instructionStep Save Settings... instructionStep saves settings.


Software Updates

Navigation: Menu >

Software Updates

 Return to chapter overview

The Software Updates menu controls how often software updates are downloaded.

If you've been notified of a new software release to Thread Lock Checker or just want to see if there's a new version, this feature makes it easy to update.

menu Software Updates menu instructionStep Check for software updates instructionStep checks for updates and shows the software update dialog if any exist

An internet connection is needed to be able to make contact with our servers.

note Before updating the software, close the help manual, and end any active session by closing target programs.

If no updates are available, you'll just see this message:

Software Update dialog

If a software update is available for Thread Lock Checker you'll see the software update dialog.

·Download and install instructionStep downloads the update, showing progress

Once the update has downloaded, Thread Lock Checker will close, run the installer, and restart.

You can stop the download at any time, if necessary.

·Don't download... instructionStep Doesn't download, but you'll be prompted for it again next time you start Thread Lock Checker

·Skip this version... instructionStep Doesn't download the update and doesn't bother you again until there's an even newer update

·Software update options... instructionStep edit the software update schedule

Problems downloading or installing?

If for whatever reason, automatic download and installation fails to complete:

·Download the latest installer manually from the software verify website.

Make some checks for possible scenarios where files may be locked by Thread Lock Checker as follows:

·Ensure Thread Lock Checker and its help manual is also closed

·Ensure any error dialogs from the previous installation are closed

You should now be ready to run the new version.

Software update schedule

Thread Lock Checker can automatically check to see if a new version of Thread Lock Checker is available for downloading.

menu Software Updates menu instructionStep Configure software updates instructionStep shows the software update schedule dialog

The update options are:

·never check for updates

·check daily (the default)

·check weekly

·check monthly

The most recent check for updates is shown at the bottom.

Software update directory

It’s important to be able to specify where software updates are downloaded to because of potential security risks that may arise from allowing the TMP directory to be executable. For example, to counteract security threats it's possible that account ownership permissions or antivirus software blocks program execution directly from the TMP directory.

The TMP directory is the default location but if for whatever reason you're not comfortable with that, you can specify your preferred download directory. This allows you to set permissions for TMP to deny execute privileges if you wish.

menu Software Updates menu instructionStep Set software update directory instructionStep shows the Software update download directory dialog

An invalid directory will show the path in red and will not be accepted until a valid folder is entered.

Example reasons for invalid directories include:

·the directory doesn't exist

·the directory doesn't have write privilege (update can't be downloaded)

·the directory doesn't have execute privilege (downloaded update can't be run)

note When modifying the download directory, you should ensure the directory will continue to be valid. Updates may no longer occur if the download location is later invalidated.

·Reset instructionStep reverts the download location to the user's TMP directory

The default location is c:\users\[username]\AppData\Local\Temp


Help

Navigation: Menu >

Help

 Return to chapter overview

The Help menu controls displaying this help document and displaying information about Thread Lock Checker.

Help menu instructionStep About Thread Lock Checker... instructionStep displays information about Thread Lock Checker.

Help menu instructionStep Readme and Version History... instructionStep displays the readme and version history.

Help menu instructionStep Help Topics... instructionStep displays this help file.

Help menu instructionStep Help PDF... instructionStep displays this help file in PDF format.

Help menu instructionStep Help on softwareverify.com... instructionStep display the Software Verify documentation web page where you can view online documentation or download compiled HTML Help and PDF help documents.

Help menu instructionStep Blog... instructionStep display the Software Verify blog.

Help menu instructionStep Library... instructionStep display the Software Verify library - our best blog articles grouped by related topics.

Help menu instructionStep Contact customer support... instructionStep displays the options for contacting customer support.

Click a link to contact customer support.

Help menu instructionStep How do I?... instructionStep displays the options for asking us how to do a particular task.


The user interface

Navigation: »No topics above this level«

The user interface

 Return to chapter overview

The Thread Lock Checker user interface is split into three sections:

·Menu

·Error report grid

·Source code viewer

Error Report Grid

The error report grid displays one error/warning per line.

Each line contains the type of lock that was checked, the reason for the error/warning, the line number and the filename of the error.

The status of each line is colour coded, with red text for lines that are most likely a coding mistake.

You can sort the data by clicking on any column header. Click again to reverse the sort direction.

Click on any line to display the source code in the lower window. Double click to edit the source code in Visual Studio.

A context menu is available on the error report grid.

The context menu has four options:

·Two options for filtering by directory and by filename. Any values set by these filters can be edited on the File Filters settings.

·An option to insert a line pragma at the end of the selected line

·An option to open an explorer window at the directory for the selected line.

Source Code Viewer

The source code viewer displays the source code with the line of interested highlighted in green.

Click on any line in the error report grid to view the source code in the source code viewer.

If you would rather edit the source code using Visual Studio, double click the line in the grid.


Modifying the settings

Navigation: »No topics above this level«

Modifying the settings

 Return to chapter overview

The settings dialog allows you to control all Thread Lock Checker settings.

The settings are grouped into logical choices making it easier to manage the settings.

Reset

Click Reset to reset all settings on all pages of the settings dialog.


Detect

Navigation: Modifying the settings >

Detect

 Return to chapter overview

The Detect page of the settings dialog allows you to control which types of error you are interested in.

Detect lock usage

Thread Lock Checker allows you to detect a variety of different lock usage patterns. Depending on how you use your lock classes you will be interested in different groups of the patterns. Select the checkbox next to the types of usage you want Thread Lock Checker to report.

Detect locked locks

Detect lock usage of the form

CSingleLock lock(&sect, TRUE);

Detect unlocked locks

Detect lock usage of the form

CSingleLock lock(&sect, FALSE);

Detect default unlocked locks

Detect lock usage of the form

CSingleLock lock(&sect);

Detect unknown unlocked locks

Detect lock usage of the form

CSingleLock lock(&sect, variable);

Detect missing lock variables

Detect lock usage of the form

CSingleLock(&sect, variable);

Detect other form of lock

Detect an alternate usage of the lock

ACE_Guard<ACE_LOCK>(ACE_LOCK l);

Detect do not use

Detect lock that should not be used

CBadlock();

Reset

Click Reset to reset all settings on all pages of the settings dialog.


Lock Type

Navigation: Modifying the settings >

Lock Type

 Return to chapter overview

The Lock Type page of the settings dialog allows you to specify lock types Thread Lock Checker will search for.

The default list of lock types that Thread Lock Checker will scan for are listed here.

You can add and remove lock classes that should be scanned.

Add

Click Add to add a new lock class.

The Add Lock dialog box will be displayed. Type the name of the new class and click OK.

Remove

Click Remove to remove the selected lock classes.

Remove All

Click Remove All to remove all lock classes.

Defaults

Click Defaults to restore the default lock classes.

Reset

Click Reset to reset all settings on all pages of the settings dialog.


File Filters

Navigation: Modifying the settings >

File Filters

 Return to chapter overview

The File Filters page of the settings dialog allows you to specify directories and files that Thread Lock Checker will ignore when searching for thread lock errors.

This allows you to ignore directories files where you deliberately have special case usage of these lock types (unit tests, development work, custom use cases) that would trigger warning results in Thread Lock Checker that you don't want.

Add Dir...

Click Add Dir... to add a directory. The Microsoft directory chooser will be displayed.

Add File...

Click Add File... to add a file. The Microsoft file chooser will be displayed.

Remove

Click Remove to remove the selected directories and files.

Remove All

Click Remove All to remove all directories and files.

Reset

Click Reset to reset all settings on all pages of the settings dialog.


Line Pragma

Navigation: Modifying the settings >

Line Pragma

 Return to chapter overview

The Line Pragma page of the settings dialog allows you to specify a line pragma that can be used to mark individual locks to be ignored when checking for thread locking errors.

This allows you identify special lock use cases in your source code to avoid FALSE positives from Thread Lock Checker.

When line pragmas are enabled any line containing the specified line pragma in a comment (single line comment or multi-line comment) will be ignored when checking for thread locking errors.

If the line pragma is enabled, the line pragma cannot be empty or whitespace. We recommend a value that is unique across your codebase so that you can find all line pragmas easily if you need to search for them.

Example usage of the pragma in code:

{
CSingleLock lock(&critSect, FALSE); // SVL_TLC_PRAGMA, this lock is intentionally unlocked to start with

...
}


How to use Thread Lock Checker

Navigation: »No topics above this level«

How to use Thread Lock Checker

 Return to chapter overview

To use Thread Lock Checker follow these basic steps:

1. If you want to change the type of lock usage to scan for, or to change the type of lock classes to scan for, Edit > Settings... to open the settings dialog.

2. File > Scan directory... to display the directory chooser.
directoryScan
You can type the directory path or use the Microsoft directory chooser by clicking Browse....
When you are happy with your choice of directory click Start Scan to start the process of finding locking errors.

3. If at any time you want to stop the scan File > Stop scan.

4. Any lock errors are shown in the grid.
errorReportGrid

5. Select an error shown in the grid to view the source code in the source code window.
sourceCodeViewer
Double click on the error to edit the source code in Visual Studio.

6. If you want to clear the results, File > Clear.

7. If you want to filter a location by directory, right click on the entry in the list and choose Filter Directory.

8. If you want to filter a location by filename, right click on the entry in the list and choose Filter Filename.

9. If you want to mark a lock to be ignored for lock checking, right click on the entry in the list and choose Add Line Pragma to Source Code.

10. If you want to go to the source directory, right click on the entry in the list and choose Open Folder...


Command Line Interface

Navigation: »No topics above this level«

Command Line Interface

 Return to chapter overview

Thread Lock Checker can be used from the command line as well as with the GUI.

User interface

If command line arguments are detected the user interface is not displayed.

Error reporting

When running from the command line any errors are written to the output file specified on the command line.

Return code

The process return code is 0 for no errors found.

If there are threading errors found the return code is a positive integer describing the number of errors found.


Alphabetic Reference

Navigation: Command Line Interface >

Alphabetic Reference

 Return to chapter overview

/addFileFilter

Adds a filename or directory to the list of file filters Thread Lock Checker will examine when checking for thread locking errors.

/addFileFilter filename

/addFileFilter directory

Example: /addFileFilter e:\om\c\threadLockChecker\tlcExample\tlcExample.cpp

Example: /addFileFilter e:\om\c\threadLockChecker\tlcExample\

/addLockType

Adds a lock type to the list of lock types Thread Lock Checker will check.

/addLockType type

Example: ./addLockType CSingleLock

/detectDefaultUnlocked

Thread Lock Checker will detect locks configured as CSingleLock lock(&sect);

This looks like it's locked, but it's actually not locked (the default value for the second parameter is FALSE).

/detectDefaultUnlocked:On|Off

/detectLocked

Thread Lock Checker will detect locks configured as CSingleLock lock(&sect, TRUE);

This lock is locked. That's usually desirable behaviour. This checking option is normally turned off as you don't normally want to detect correct behaviour.

/detectLocked:On|Off

Example: /detectLocked:On

Example: /detectLocked:Off

/detectNoLock

Thread Lock Checker will detect locks configured as CSingleLock(, variable);

This last case is a compile error. As such it is unlikely to get to the point where you'll need to catch this before a commit to your version control system. But we detect such errors for completeness of error detection.

/detectNoLock:On|Off

/detectNoLockVariable

Thread Lock Checker will detect locks configured as CSingleLock(&sect, variable);

Note, the variable 'lock' in the other examples is missing.

/detectNoLockVariable:On|Off

/detectUnknownUnlocked

Thread Lock Checker will detect locks configured as CSingleLock lock(&sect, variable);

In this case we don't know if variable is TRUE or FALSE, so we bring this to your attention for manual checking.

/detectUnknownUnlocked:On|Off

/detectUnlocked

Thread Lock Checker will detect locks configured as CSingleLock lock(&sect, FALSE);

This lock isn't locked. Is this really what you want?

/detectUnlocked:On|Off

/dir

Specifies the directory hierarchy that will be scanned by Thread Lock Checker.

/dir directory

Example: /dir e:\om\c\

/linePragma

Specifies the line pragma to use if line pragmas are enabled.

/linePragma pragma

Example: /linePragma SVL_TLC_PRAGMA

Example usage of the pragma in code:

CSingleLock        lock(&critSect, FALSE);                // SVL_TLC_PRAGMA, this lock is intentionally unlocked to start with

/linePragmaEnable

Enables or disables the ignoring of locks if a line pragma is found in a comment on the same line as the lock declaration.

If you use this option to enable line pragmas you must use /linePragma to specify a line pragma to use. If you don't specify a line pragma this option does nothing.

/linePragmaEnable:On|Off

Example: /linePragmaEnable:On

Example: /linePragmaEnable:Off

/loadSettings

Specifies a file to load that contains settings that will override the current settings for this command line search.

/loadSettings filename

Example: /loadSettings e:\tests\test1\testSettings.tlc

/output

Specifies a filename to write the results of the command line search.

If no errors are found any file with this name will be deleted.

If errors are found a text file will be written containing error information. Error information will be listed one error per line.

/output filename

Example: /output e:\tests\test1\testResults.txt

/removeAllFileFilters

Removes all file filters from the list of file filters Thread Lock Checker will use to check which files and directories to ignore when checking for thread locking errors.

This option should be used before any use of /addFileFilter.

/removeAllFileFilters

/removeAllLockTypes

Removes all lock types from the list of lock types Thread Lock Checker will check.

This option should be used before any use of /addLockType.

/removeAllLockTypes

/reset

Reset all settings to the default values for this command line search.

You should put this first on your command line to create a known default state prior to setting values using the command line.

/reset

/turnAllDetectOff

Turns off all detect options.

You should put this before any /detectXXXXX options if you wish to start from a known (nothing detected) state when setting detect options.

/turnAllDetectOff


Usage Reference

Navigation: Command Line Interface >

Usage Reference

 Return to chapter overview

Search

/dir

Specifies the directory hierarchy that will be scanned by Thread Lock Checker.

/dir directory

Example: /dir e:\om\c\

Detect

All /detectXXXX options are followed by :On or :Off to enable or disable the option

/detectLocked

Thread Lock Checker will detect locks configured as CSingleLock lock(&sect, TRUE);

This lock is locked. That's usually desirable behaviour. This checking option is normally turned off as you don't normally want to detect correct behaviour.

/detectLocked:On|Off

Example: /detectLocked:On

Example: /detectLocked:Off

/detectUnlocked

Thread Lock Checker will detect locks configured as CSingleLock lock(&sect, FALSE);

This lock isn't locked. Is this really what you want?

/detectUnlocked:On|Off

/detectDefaultUnlocked

Thread Lock Checker will detect locks configured as CSingleLock lock(&sect);

This looks like it's locked, but it's actually not locked (the default value for the second parameter is FALSE).

/detectDefaultUnlocked:On|Off

/detectUnknownUnlocked

Thread Lock Checker will detect locks configured as CSingleLock lock(&sect, variable);

In this case we don't know if variable is TRUE or FALSE, so we bring this to your attention for manual checking.

/detectUnknownUnlocked:On|Off

/detectNoLockVariable

Thread Lock Checker will detect locks configured as CSingleLock(&sect, variable);

Note, the variable 'lock' in the other examples is missing.

/detectNoLockVariable:On|Off

/detectNoLock

Thread Lock Checker will detect locks configured as CSingleLock(, variable);

This last case is a compile error. As such it is unlikely to get to the point where you'll need to catch this before a commit to your version control system. But we detect such errors for completeness of error detection.

/detectNoLock:On|Off

/turnAllDetectOff

Turns off all detect options.

You should put this before any /detectXXXXX options if you wish to start from a known (nothing detected) state when setting detect options.

/turnAllDetectOff

Lock Types

/addLockType

Adds a lock type to the list of lock types Thread Lock Checker will check.

/addLockType type

Example: ./addLockType CSingleLock

/removeAllLockTypes

Removes all lock types from the list of lock types Thread Lock Checker will check.

This option should be used before any use of /addLockType.

/removeAllLockTypes

File Filters

/addFileFilter

Adds a filename or directory to the list of file filters Thread Lock Checker will examine when checking for thread locking errors.

/addFileFilter filename

/addFileFilter directory

Example: /addFileFilter e:\om\c\threadLockChecker\tlcExample\tlcExample.cpp

Example: /addFileFilter e:\om\c\threadLockChecker\tlcExample\

/removeAllFileFilters

Removes all file filters from the list of file filters Thread Lock Checker will use to check which files and directories to ignore when checking for thread locking errors.

This option should be used before any use of /addFileFilter.

/removeAllFileFilters

Line Pragma

/linePragmaEnable

Enables or disables the ignoring of locks if a line pragma is found in a comment on the same line as the lock declaration.

If you use this option to enable line pragmas you must use /linePragma to specify a line pragma to use. If you don't specify a line pragma this option does nothing.

/linePragmaEnable:On|Off

Example: /linePragmaEnable:On

Example: /linePragmaEnable:Off

/linePragma

Specifies the line pragma to use if line pragmas are enabled.

/linePragma pragma

Example: /linePragma SVL_TLC_PRAGMA

Example usage of the pragma in code:

CSingleLock        lock(&critSect, FALSE);                // SVL_TLC_PRAGMA, this lock is intentionally unlocked to start with

Miscellaneous

/loadSettings

Specifies a file to load that contains settings that will override the current settings for this command line search.

/loadSettings filename

Example: /loadSettings e:\tests\test1\testSettings.tlc

/output

Specifies a filename to write the results of the command line search.

If no errors are found any file with this name will be deleted.

If errors are found a text file will be written containing error information. Error information will be listed one error per line.

/output filename

Example: /output e:\tests\test1\testResults.txt

/reset

Reset all settings to the default values for this command line search.

You should put this first on your command line to create a known default state prior to setting values using the command line.

/reset


Command Line Examples

Navigation: Command Line Interface >

Command Line Examples

 Return to chapter overview

This section provides some example command lines. For each example we'll break it down, argument by argument so that you can see how the command line works.

In all these examples the executable to run is threadLockChecker.exe. You will need to provide the full path to threadLockChecker.exe, or add the path to threadLockChecker install directory to your $PATH.

Example 1

threadLockChecker.exe /dir e:\om\c\ /output e:\test.txt

/dir e:\om\c\

Scan the directory e:\om\c\

/output e:\test.txt

Write the output to e:\test.txt. If there are no errors there will be no output file.

Example 2

threadLockChecker.exe /dir e:\om\c\ /output e:\test.txt /removeAllLockTypes /addLockType CSingleLock

/dir e:\om\c\

Scan the directory e:\om\c\

/output e:\test.txt

Write the output to e:\test.txt. If there are no errors there will be no output file.

/removeAllLockTypes

Remove all existing lock type definitions.

/addLockType CSingleLock

Add one lock type definition so that Thread Lock Checker is checking for just the type CSingleLock

Example 3

threadLockChecker.exe /loadSettings e:\tests\test1\settings.tlc /output e:\test.txt

/loadSettings e:\tests\test1\settings.tlc

Load settings from the file e:\tests\test1\settings.tlc.

/output e:\test.txt

Write the output to e:\test.txt. If there are no errors there will be no output file.

Example 4

threadLockChecker.exe /loadSettings e:\tests\test1\settings.tlc /output e:\test.txt /dir e:\om\c\

/loadSettings e:\tests\test1\settings.tlc

Load settings from the file e:\tests\test1\settings.tlc.

/output e:\test.txt

Write the output to e:\test.txt. If there are no errors there will be no output file.

/dir e:\om\c\

Scan the directory e:\om\c\