The main function must have return type int.

This fixes a GCC warning.
Include missing headers.

This fixes GCC warnings.
Add missing return statement.

This fixes a GCC warning.
Remove unnecessary global variables.

The r1 and r2 ints are only used in main().
Use whitespace consistently.
Merge pull request #29 from jwakely/improve-c-threads

Improve C threads example