Some thread macros had semicolons at their end, some did not. Most of the changes are to make them consistent: no semicolon at the end of a macro, so its use always require semicolon in the expansion site.
The OGRE_LOCK_MUTEX macro always generate the same name for the locking variable, which sometimes shadows a previous instance. The macro was changed to append the line number to the name, so it never happens (unless the macro happens to be used twice in the same row).
A few warnings were eliminated by proper casting; one warning was suppressed by explicit parenthesizing a boolean expression.
Great work! Looks similar to the solution that I started a couple months ago but never got to finish.