New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with std::mutex (c++11) #34
Comments
You are probably the first one trying it. I haven't looked in to the implementation of An alternative would be to implement the C++ threading via native threads. |
Please also have a look at #12. It contains some instructions how to build the compiler with enabled pthreads support. |
I built a native compiler with posix threads (proven by gcc -v). But it doesn't seem to be enough because most of the mutex header is ignored due to missing definitions. -U__STRICT_ANSI__ helps with _GLIBCXX_USE_C99_STDINT_TR1, but the next issue is with _GLIBCXX_HAS_GTHREADS. |
same with std::once_flag
And it is in the same file wrapped around "#ifdef GLIBCXX_HAS_GTHREADS" |
I've changed some include files on my local installation to use gthr-posix.h instead of gthr.h and i've compiled my test project using -U__STRICT_ANSI__ -D_GLIBCXX_HAS_GTHREADS. |
I can confirm that it works correctly. |
A patch proposal https://gist.github.com/afxgroup/88598aef4f2c768955b7bd939709e738 |
As part of Issue #12, mutex support should be functional as well (apart from bugs of course). Note that it is implemented only for gcc 8 for now (and you have to choose the |
Fantastic news! Is there a prebuilt gcc 8 binary available for testing, yet? |
Not yet, but you can easily compile one yourself on a Linux machine. |
The standard procedure now enables the amigaos threading automatically, if gcc 8 is compiled. |
Regularly built versions for AmigaOS can be obtained from https://dl.bintray.com/sba1/adtools-native/. If there are any problems (which is likely), please file a new Issue. |
I can't compile code with std::mutex. Should it be supported?
2.Code:test> which g++
Code:adtools-os4-20170623-404/bin/g++
2.Code:test> g++ -c -std=c++11 mutex.cpp
mutex.cpp: In function 'int main()':
mutex.cpp:5:2: error: 'mutex' is not a member of 'std'
std::mutex m;
^
The text was updated successfully, but these errors were encountered: