[haiku-bugs] [Haiku] #7916: mutex compiler support in gcc 4.5.3

  • From: "diger" <trac@xxxxxxxxxxxx>
  • Date: Fri, 12 Aug 2011 21:16:31 -0000

#7916: mutex compiler support in gcc 4.5.3
--------------------------+-------------------------
 Reporter:  diger         |        Owner:  bonefish
     Type:  bug           |       Status:  new
 Priority:  normal        |    Milestone:  R1
Component:  Build System  |      Version:  R1/alpha3
 Keywords:                |   Blocked By:
 Blocking:                |  Has a Patch:  0
 Platform:  All           |
--------------------------+-------------------------
 r42598 gcc4

 Eiskalt DC++ compilation reportedly fails due to std::mutex

 {{{
 /boot/develop/abi/x86/gcc4/tools/gcc-4.5.3-haiku-110620/lib/gcc/i586-pc-
 haiku/4.5.3/../../../../include/c++/4.5.3/bits/c++0x_warning.h:31:2:
 error: #error This file requires compiler and library support for the
 upcoming ISO C++ standard, C++0x. This support is currently experimental,
 and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.
 test.cpp:6:1: error: 'mutex' in namespace 'std' does not name a type
 test.cpp: In function 'void thread_func1()':
 }}}

 Haiku gcc4 have not support std::mutex
 How-To-Repeat:

  C++ compile the following test case:
 {{{
 #include <vector>
 #include <mutex>
 #include <thread>

 std::vector<int> x;
 std::mutex mutex;

 void thread_func1()
 {
  mutex.lock();
  x.push_back(0);
  mutex.unlock();
 }
 void thread_func2()
 {
  mutex.lock();
  x.pop_back();
  mutex.unlock();
 }

 int main()
 {
  std::thread th1(thread_func1);
  std::thread th2(thread_func2);

  th1.join();
  th2.join();
 }

 }}}

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/7916>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: