The coroutine package provides classes for making Java threads function somewhat like coroutines. Only one of such threads may execute at any time.