Boost logo

Boost Users :

Subject: [Boost-users] Problem with boost threads on hpux
From: John Parke (john.parke_at_[hidden])
Date: 2019-02-19 23:49:32


Hi:

I am trying to use boost threads with condition variables on hpux with aCC compiler.
The compiler has incomplete support of C++11 standard.
It does not have <chrono> or <thread> headers.

I get the following error message when compiling a program which is using condition variables:

"/usr/local/include/boost/thread/pthread/thread_data.hpp", line 344: error #2135:
          namespace "boost::chrono" has no member "steady_clock"
            void sleep_until(const chrono::time_point<chrono::steady_clock, Duration>& t)
            
                                                 ^
The c++ code is
   {
      while (bufferIsEmpty[bufferPairNo])
      {
         boost::unique_lock<boost::mutex> lock (bufferIsEmptyMutex[bufferPairNo]);
   =>> zb_bufferIsEmptyCondVar[bufferPairNo].wait_for (lock, boost::chrono::microseconds (100));
      }
   }

The version of boost I am using is 1.69.0.
I build boost with:

./bjam -a -j6 install --build-dir=build address-model=64 variant=release link=static \
threading=multi runtime-link=static \
 define=BOOST_THREAD_DONT_USE_CHRONO \
 --with-date_time --with-filesystem \
--with-system --with-thread

When I look at the boost header file, I see this:

boost/thread/pthread/ thread_data.hpp

#ifdef BOOST_THREAD_USES_CHRONO
          template <class Rep, class Period>
          void sleep_for(const chrono::duration<Rep, Period>& d)
          {
            hidden::sleep_for_internal(detail::platform_duration(d));
          }

          template <class Duration>
line 344 >> void sleep_until(const chrono::time_point<chrono::steady_clock, Duration>& t)
          {
            sleep_for(t - chrono::steady_clock::now());
          }

It appears that the define=BOOST_THREAD_DONT_USE_CHRONO, had no affect.

Have I built this correctly, or is there another problem?

I would greatly appreciate any help on this.

Best regards,

John

John Parke
Alebra Technologies Inc.
PO Box 120390
New Brighton, MN  55112
770-425-1810


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net