Anthony Williams wrote:
If you declare variables "extern" at block scope then you need to provide a declaration at global scope too.
The point of declaring them extern in the example is to say that these variables are accessible to, and used by, code elsewhere in the system. In particular, another thread will lock the mutex, set done to true and then notify the condition variable.
Anthony Thank you for your explanation, Anthony.
As I am relatively new to threading, I have another question regarding your example: Are those variables considered to be for thread local storage. And if, would it be preferable then to use the 'extern' specifier in general? The problem for me (as a novice) on this example is, that it is shown in a very isolated context. Another question: When will the patches for the Sun Compiler be integrated into the trunk. For me, I use the CC 5.10 version, these patches worked well. Roman