Refactored thread constant on windows