Skip to content

Standard threads implementation currently still missing on MinGW GCC on Windows

Notifications You must be signed in to change notification settings

eswartz/mingw-std-threads

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mingw-std-threads

Standard C++11 threading classes implementation, which are currently still missing on MinGW GCC.

Usage

This is a header-only library. To use, just include the corresponding mingw.xxx.h file, where xxx would be the name of the standard header that you would normally include. For additional mutex helper classes, such as std::scoped_guard or std::unique_lock, you need to include <mutex> before including mingw.mutex.h

Compatibility

This code has been developed with MinGW64 4.8.2, but should work with any other MinGW version that has C++11 support for lambda functions, variadic templates, and has working mutex helper classes in <mutex>

Why MinGW has no threading classes

It seems that for cross-platform threading implementation, the GCC standard library relies on the gthreads library. If this library is not available, as is the case with MinGW, the std::thread, std::mutex, std::condition_variable are not defined. However, higher-level mutex helper classes are still defined in <mutex> and are usable. Hence, this implementation does not re-define them, and to use these helpers, you should include <mutex> as well, as explained in the usage section.

About

Standard threads implementation currently still missing on MinGW GCC on Windows

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 99.3%
  • CMake 0.7%