add spin lock & thread safe coroutine base class