You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Andrew Cox (JIRA)" <ji...@apache.org> on 2012/05/23 19:58:41 UTC

[jira] [Commented] (THRIFT-1585) C++ library fails to build with OS X pthread implementation

    [ https://issues.apache.org/jira/browse/THRIFT-1585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13281756#comment-13281756 ] 

Andrew Cox commented on THRIFT-1585:
------------------------------------

Can we get this patch committed? The existing code (before the patch) is broken in practice on OS X, and it violates a basic rules:
- it assumes the pthread implementation defines pthread_t as a type that is binary-compatible with uint64_t
- it makes a different declaration of the interface Thread abstraction interface (specifically Thread::is_current) depending on the threading implementation
- it exposes an implementation-specific type (pthread_t) on the interface

                
> C++ library fails to build with OS X pthread implementation
> -----------------------------------------------------------
>
>                 Key: THRIFT-1585
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1585
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9
>         Environment: OS X 10.7, i686-apple-darwin11-llvm-gcc-4.2 resp. Apple clang version 3.1
>            Reporter: David Nadlinger
>         Attachments: 0001-THRIFT-1585-C-library-fails-to-build-with-OS-X-pthread.patch
>
>
> On OS X, {{pthread_t}} is {{_opaque_pthread_t*}}, but the current implementation assumes that it is implicitly convertible to {{uint64_t}}.
> This yields to:
> {quote}
> src/thrift/server/TNonblockingServer.cpp: In member function 'void apache::thrift::server::TNonblockingIOThread::breakLoop(bool)':
> src/thrift/server/TNonblockingServer.cpp:1433: error: invalid conversion from 'uint64_t' to '_opaque_pthread_t*'
> src/thrift/server/TNonblockingServer.cpp:1433: error:   initializing argument 1 of 'static bool apache::thrift::concurrency::Thread::is_current(_opaque_pthread_t*)'
> {quote}

--
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