I've been trying to use std::async(std::launch:async, &MyClass::function, this, args) to launch a new thread that does some tasks. My old implementation is using std::thread and it works, and after I switch everything to std::async, the code compiles(so no syntax error), but the program freezes every time when it executes the code that invokes std::async. After hours of readings, I don't think this piece of code is wrong. I suspect that std::async just doesn't work with MinGW32_64 on Windows. p.s. I'm using MinGW32_w64 7.2.0, thread model is posix, and gcc version is 7.2.0
Aucun commentaire:
Enregistrer un commentaire