Rename SUSPENDED_MARKER to COROUTINE_SUSPENDED

This commit is contained in:
Denis Zharkov
2017-01-27 17:29:36 +03:00
parent 246946bc18
commit c362a9154b
123 changed files with 169 additions and 169 deletions
+6 -6
View File
@@ -111,9 +111,9 @@ internal abstract class CoroutineImpl(private val resultContinuation: Continuati
protected fun doResumeWrapper() {
try {
result = doResume()
if (result != SUSPENDED_MARKER) {
if (result != COROUTINE_SUSPENDED) {
val data = result
result = SUSPENDED_MARKER
result = COROUTINE_SUSPENDED
resultContinuation.resume(data)
}
}
@@ -140,7 +140,7 @@ internal class SafeContinuation<in T> internal constructor(private val delegate:
UNDECIDED -> {
result = value
}
SUSPENDED_MARKER -> {
COROUTINE_SUSPENDED -> {
result = RESUMED
delegate.resume(value)
}
@@ -155,7 +155,7 @@ internal class SafeContinuation<in T> internal constructor(private val delegate:
UNDECIDED -> {
result = Fail(exception)
}
SUSPENDED_MARKER -> {
COROUTINE_SUSPENDED -> {
result = RESUMED
delegate.resumeWithException(exception)
}
@@ -167,12 +167,12 @@ internal class SafeContinuation<in T> internal constructor(private val delegate:
internal fun getResult(): Any? {
if (result == UNDECIDED) {
result = SUSPENDED_MARKER
result = COROUTINE_SUSPENDED
}
val result = this.result
return when (result) {
RESUMED -> {
SUSPENDED_MARKER // already called continuation, indicate SUSPENDED upstream
COROUTINE_SUSPENDED // already called continuation, indicate SUSPENDED upstream
}
is Fail -> {
throw result.exception