boostorg/coroutine — pull request #18 by microcai (2014-12-06 08:04:25+00:00)
Title: allow Win32 Fiber as alternative context switch API

Hi Oliver Kowalke,

last weak, I report a bug that boost.context causes LoadLibrary to fail.
And you response that might because boost.context didn't swap all TIB parts.

Allowing alternative context switch API other than reverse-engineered boost.context might solve the problem. So I speed some time to write the patch.

users that wish to use Win32 API shoul define BOOST_COROUTINE_USE_FIBER
then users should be responsibe to make sure all threads that might call coroutine must be converted to fiber first.
since IsThreadAFIber() is not available on some windows platform.

if the user can make 100% sure that the platform he/she wish to support has IsThreadAFIber(), then define BOOST_COROUTINE_USE_IS_THREAD_A_FIBER
and boost.coroutine will take care of converting to fiber and converting back to thread.