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

C++ library assumes optional function pthread_attr_setschedpolicy is available

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.10.0
    • Fix Version/s: 0.10.0
    • Component/s: C++ - Library
    • Environment:

      gcc 4.8.5 on Haiku hrev49934 (x86)

      Description

      Building on Haiku the latest code from git fails with

      src/thrift/concurrency/PosixThreadFactory.cpp: In member function 'virtual void apache::thrift::concurrency::PthreadThread::start()':
      src/thrift/concurrency/PosixThreadFactory.cpp:127:58: error: 'pthread_attr_setschedpolicy' was not declared in this scope
           if (pthread_attr_setschedpolicy(&thread_attr, policy_) != 0) {
      

      This is because pthread_attr_setschedpolicy is in fact an optional function POSIX implementations are not required to provide—and Haiku's POSIX-compatibility layer does not.

      Thrift should be checking for the availability of this function before including it in the source code. (Nothing else seems to rely on the thread-scheduling policy being available, so it's just a matter of omitting this one function call.)

        Attachments

          Activity

            People

            • Assignee:
              simonsouth Simon South
              Reporter:
              simonsouth Simon South
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: