ソースを参照

Remove workaround for an old threading bug in Visual Studio 2013.

According to https://devblogs.microsoft.com/cppblog/stl-fixes-in-vs-2015-part-2/
this was fixed in VS 2015.
pull/1/head
Sam Hocevar 4年前
コミット
b85dc6cd00
1個のファイルの変更1行の追加23行の削除
  1. +1
    -23
      include/lol/private/sys/threading.h

+ 1
- 23
include/lol/private/sys/threading.h ファイルの表示

@@ -26,26 +26,11 @@
#include <chrono> // std::chrono
#include <cassert> // assert()

/* XXX: workaround for a bug in Visual Studio 2012 and 2013!
* https://connect.microsoft.com/VisualStudio/feedback/details/747145 */
#if defined(_MSC_VER) && (_MSC_VER < 1900)
# define LOL_VISUAL_STUDIO_BUG_747145_WORKAROUND 1
# ifdef WIN32_LEAN_AND_MEAN
# include <windows.h>
# else
# define WIN32_LEAN_AND_MEAN 1
# include <windows.h>
# undef WIN32_LEAN_AND_MEAN
# endif
#endif

/* XXX: workaround for missing std::thread in mingw */
#if _GLIBCXX_MUTEX && !_GLIBCXX_HAS_GTHREADS && _WIN32
# include "../3rdparty/mingw-std-threads/mingw.thread.h"
# include "../3rdparty/mingw-std-threads/mingw.mutex.h"
# include "../3rdparty/mingw-std-threads/mingw.condition_variable.h"
# undef near /* Fuck Microsoft */
# undef far /* Fuck Microsoft again */
#endif

namespace lol
@@ -63,11 +48,7 @@ public:

~thread()
{
#if LOL_VISUAL_STUDIO_BUG_747145_WORKAROUND
m_thread.detach();
#else
m_thread.join();
#endif
}

// FIXME: move to os::has_threads?
@@ -86,9 +67,6 @@ private:
static void trampoline(thread *that)
{
that->m_function(that);
#if LOL_VISUAL_STUDIO_BUG_747145_WORKAROUND
ExitThread(0);
#endif
}

std::thread m_thread;
@@ -265,5 +243,5 @@ private:
}
};

} /* namespace lol */
} // namespace lol


読み込み中…
キャンセル
保存