Skip to content
Extraits de code Groupes Projets
Valider 50f2e550 rédigé par Thomas Goyne's avatar Thomas Goyne
Parcourir les fichiers

Use std::thread with libc++

boost::thread is only used due to libstdc++ 4.8 missing a bunch of
stuff.
parent 6477ef93
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -12,7 +12,13 @@ ...@@ -12,7 +12,13 @@
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <cstddef>
#ifdef _LIBCPP_VERSION
#include <thread>
#else
#include <boost/thread.hpp> #include <boost/thread.hpp>
#endif
namespace agi { namespace util { namespace agi { namespace util {
...@@ -25,7 +31,11 @@ timeval time_log() { ...@@ -25,7 +31,11 @@ timeval time_log() {
void SetThreadName(const char *) { } void SetThreadName(const char *) { }
void sleep_for(int ms) { void sleep_for(int ms) {
#ifdef __clang__
std::this_thread::sleep_for(std::chrono::milliseconds(ms));
#else
boost::this_thread::sleep_for(boost::chrono::milliseconds(ms)); boost::this_thread::sleep_for(boost::chrono::milliseconds(ms));
#endif
} }
} } } }
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter