[ 
https://issues.apache.org/jira/browse/THRIFT-1387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

alexandre parenteau updated THRIFT-1387:
----------------------------------------

    Attachment: THRIFT-1387_BoostThreadsWin_v2.patch

@peace: following our offline discussion, here is included a replacement for 
your patch, which essentially does the same, but also:

- include the same change suggested by peace, adding concurrent/Boost*
- really fixed the force_inc.h situation, the way it was intended originally
- add 64 bits targets
- update the README.windows, removing pthread, adding more details on linking 
with boost thread (static vs shared)
- add/fix all remaining missing .cpp for Windows (except SSLSocket) to vc 
projects
- renamed Windows/Fcntl[.h,.cpp] to Windows/WinFnctl[.h/cpp]: this conflicts 
with <fcntl.h>, needed for TFileTransport
- fix poll to not be defined, but inlined (conflict with boost ASIO otherwise)
- Add BOOST_ALL_NO_LIB to force_inc.h (and section in README.WINDOWS to 
document how to link boost static vs shared)

                
> Build MSVC libraries with Boost Threads instead of Pthreads
> -----------------------------------------------------------
>
>                 Key: THRIFT-1387
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1387
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.8
>         Environment: Windows - Visual Studio
>            Reporter: Peace C
>            Priority: Minor
>              Labels: boost, msvc, pthreads, studio, threads, visual, windows
>             Fix For: 0.8
>
>         Attachments: THRIFT-1387_BoostThreadsWin.patch, 
> THRIFT-1387_BoostThreadsWin_v2.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to