THRIFT-4166: fix recent VC2010 build regression and prevent it in the future
Client: cpp

This closes #1237
diff --git a/build/appveyor/MSVC-appveyor-build.bat b/build/appveyor/MSVC-appveyor-build.bat
index ee022cb..054a8b4 100644
--- a/build/appveyor/MSVC-appveyor-build.bat
+++ b/build/appveyor/MSVC-appveyor-build.bat
@@ -35,6 +35,7 @@
     -DZLIB_LIBRARY="%WIN3P%\zlib-inst\lib\zlib%ZLIB_LIB_SUFFIX%.lib" ^
     -DZLIB_ROOT="%WIN3P%\zlib-inst" ^
     -DWITH_PYTHON=%WITH_PYTHON% ^
+    -DWITH_%THREADMODEL%THREADS=ON ^
     -DWITH_SHARED_LIB=OFF ^
     -DWITH_STATIC_LIB=ON                    || EXIT /B
 @ECHO OFF
diff --git a/build/appveyor/MSVC-appveyor-install.bat b/build/appveyor/MSVC-appveyor-install.bat
index 5343d85..573700e 100644
--- a/build/appveyor/MSVC-appveyor-install.bat
+++ b/build/appveyor/MSVC-appveyor-install.bat
@@ -56,5 +56,17 @@
   7z x "msinttypes-r26.zip"               || EXIT /B
 )
 
+:: appveyor build slaves do not have MSVC2010 Boost installed
+IF "%COMPILER%" == "vc100" (
+  SET BITS=64
+  IF "%PLATFORM%" == "x86" (
+    SET BITS=32
+  )
+  SET BOOSTEXEURL=https://downloads.sourceforge.net/project/boost/boost-binaries/%BOOST_VERSION%/boost_%BOOST_VERSION:.=_%-msvc-10.0-!BITS!.exe
+  SET BOOSTEXE=C:\projects\thrift\buildcache\boost_%BOOST_VERSION:.=_%-msvc-10.0-!BITS!.exe
+  appveyor DownloadFile "!BOOSTEXEURL!" -FileName "!BOOSTEXE!" || EXIT /B
+  "!BOOSTEXE!" /dir=C:\Libraries\boost_%BOOST_VERSION:.=_% /silent || EXIT /B
+)
+
 :: Haskell (GHC) and cabal
 cinst -c "%BUILDCACHE%" -y ghc            || EXIT /B
diff --git a/build/appveyor/MSVC-appveyor-test.bat b/build/appveyor/MSVC-appveyor-test.bat
index 1737085..16ee207 100644
--- a/build/appveyor/MSVC-appveyor-test.bat
+++ b/build/appveyor/MSVC-appveyor-test.bat
@@ -22,8 +22,4 @@
 :: Add directories to the path to find DLLs of third party libraries so tests run
 SET PATH=%BOOST_LIBRARYDIR%;%OPENSSL_ROOT%\bin;%WIN3P%\zlib-inst\bin;%PATH%
 
-:: The stress test is long running on appveyor (2+ minutes)
-:: and not terribly useful with one core, so we disable it
-SET DISABLED_TESTS=StressTestNonBlocking
-
-ctest -C %CONFIGURATION% --timeout 600 -VV -E "(%DISABLED_TESTS%)" || EXIT /B
+ctest -C %CONFIGURATION% --timeout 300 -VV -E "(%DISABLED_TESTS%)" || EXIT /B
diff --git a/build/appveyor/cl_setenv.bat b/build/appveyor/cl_setenv.bat
index d907d5e..c1b956c 100644
--- a/build/appveyor/cl_setenv.bat
+++ b/build/appveyor/cl_setenv.bat
@@ -40,17 +40,29 @@
 SET INSTDIR=%APPVEYOR_BUILD_FOLDER%\local-thrift-inst
 SET SRCDIR=%APPVEYOR_BUILD_FOLDER%
 
+: PLATFORM is x64 or x86, but we want x86 to become "32" when we strip it down for paths:
+SET NORM_PLATFORM=%PLATFORM:~-2,2%
+IF "%NORM_PLATFORM%" == "86" (SET NORM_PLATFORM=32)
+
 SET BOOST_ROOT=C:\Libraries\boost_%BOOST_VERSION:.=_%
-SET BOOST_LIBRARYDIR=%BOOST_ROOT%\lib%PLATFORM:~-2,2%-msvc-%COMPILER:~-3,2%.0
-SET OPENSSL_ROOT=C:\OpenSSL-Win%PLATFORM:~-2,2%
+SET BOOST_LIBRARYDIR=%BOOST_ROOT%\lib%NORM_PLATFORM%-msvc-%COMPILER:~-3,2%.0
+SET OPENSSL_ROOT=C:\OpenSSL-Win%NORM_PLATFORM%
 SET WIN3P=%APPVEYOR_BUILD_FOLDER%\thirdparty
+
+:: MSVC2010 doesn't "do" std::thread
+IF "%COMPILER%" == "vc100" (
+  SET THREADMODEL=BOOST
+) ELSE (
+  SET THREADMODEL=STD
+)
+
 IF "%PYTHON_VERSION%" == "" (
   SET WITH_PYTHON=OFF
 ) ELSE (
   SET WITH_PYTHON=ON
   SET PATH=C:\Python%PYTHON_VERSION:.=%\scripts;C:\Python%PYTHON_VERSION:.=%;!PATH!
 )
-IF "%CONFIGURATION%" == "Debug" (SET ZLIB_STATIC_SUFFIX=d)
+IF "%CONFIGURATION%" == "Debug" (SET ZLIB_LIB_SUFFIX=d)
 
 IF NOT "%QT_VERSION%" == "" (
   IF /i "%PLATFORM%" == "x64" SET QTEXT=_64