added ENABLE_DEBUG macro
added missing thread include
Merge pull request #449 from mehlis/fix-yield

Fix yield (missing part)