Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-1387

Build MSVC libraries with Boost Threads instead of Pthreads

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Patch Available

    Description

      This patch is based on Alex's Boost threads patch (THRIFT-1361) and adds support in the MSVC project to build with Boost threads instead of Pthreads. The option is configurable using "#define HAVE_PTHREAD_H" in thrift/lib/cpp/src/windows/config.h (default is to build using Boost threads). In order to support building either way, I wrapped #if(n)def USE_BOOST_THREAD around Monitor.cpp, Mutex.cpp, PosixThreadFactory.cpp and their analogous Boost versions (BoostMonitor.cpp, BoostMutex.cpp, BoostThreadFactory.cpp).

      Remember that any code calling errno should add force_inc.h to the project's Force Include list. This tripped me up in TNonblockingServer.cpp when errno would always return 0. Using the project properties is more opaque but we can't add force_inc.h to config.h because any project using the thrift library will get the forced redefinitions (not good if the app expects the MS SDK definitions).

      I also adjusted the thrift library projects to generate appropriately named pdb files. They were defaulting to vc100.pdb, causing one project's build to stomp over the other's pdb.

      The patch was created using TortoiseHg workbench. Please notify me if the format isn't compatible with the Thrift team's patch tool and I will modify the patch accordingly.

      Attachments

        1. THRIFT-1387_BoostThreadsWin.patch
          12 kB
          Peace C
        2. THRIFT-1387_BoostThreadsWin_v2.patch
          52 kB
          alexandre parenteau
        3. THRIFT-1387_PDB.patch
          2 kB
          Peace C

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            aubonbeurre alexandre parenteau
            peace Peace C
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment