Patch by Thomas Faber: Fix broken interlocked functions See issue #6374 for more details. svn path=/trunk/; revision=52735