From b610642badda42585004c14f2fe1fa97eef638a4 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 27 Apr 2015 23:05:51 +0200 Subject: [PATCH] Mark global functions as inline. Both this_thread::get_id() and this_thread::yield() need to be marked as inline, to avoid linker errors about multiple definitions. --- mingw.thread.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mingw.thread.h b/mingw.thread.h index a625eb2..a653f23 100644 --- a/mingw.thread.h +++ b/mingw.thread.h @@ -106,8 +106,8 @@ class thread }; namespace this_thread { - thread::id get_id() {return thread::id(GetCurrentThreadId());} - void yield() {Sleep(0);} + inline thread::id get_id() {return thread::id(GetCurrentThreadId());} + inline void yield() {Sleep(0);} template< class Rep, class Period > void sleep_for( const std::chrono::duration& sleep_duration) {