std::async problems depending on Android version
I'm currently developing a native application that may run on Android devices from API 14. I'm using std::async in my code and so far it did not give any problems with API 16 to API 19 devices, but API 14 and 15 are behaving in a different way:
Example:
std::async(std::launch::async, &foo) <-- never running foo
std::async(&foo) <-- runs foo
If I flash an API 16 image on the same device, async works as expected.
I'm using CLang3.4 and the latest toolchain.
I'm also using gnustl_static.
I've read similar issues, like: NDK r9c - does not support std::future where the user reports that the LG phone will not start the second task until the first ended.
Two questions:
上一篇: 使用std :: async和模板函数