-qthreaded

Category

Object code control

Pragma equivalent

None.

Purpose

Indicates to the compiler whether it must generate threadsafe code.

Always use this option when compiling or linking multithreaded applications. This option does not make code threadsafe, but it will ensure that code already threadsafe will remain so after compilation and linking. It also ensures that all optimizations are threadsafe.

Syntax

Read syntax diagramSkip visual syntax diagram
        .-nothreaded-.   
>>- -q--+-threaded---+-----------------------------------------><

Defaults

Usage

This option applies to both compile and linker operations.

To maintain thread safety, a file compiled with the -qthreaded option, whether explicitly by option selection or implicitly by choice of _r compiler invocation mode, must also be linked with the -qthreaded option.

Predefined macros

None.

Related information