From 957acf3c0fdff1540d4c0c1005f1021763058857 Mon Sep 17 00:00:00 2001 From: codinghuang <2812240764@qq.com> Date: Sun, 30 Jun 2019 19:48:04 +0800 Subject: [PATCH] fix the bug --- src/coroutine/coroutine.cc | 4 +++- study_coroutine.cc | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/coroutine/coroutine.cc b/src/coroutine/coroutine.cc index 1fb2b39..fcb4620 100644 --- a/src/coroutine/coroutine.cc +++ b/src/coroutine/coroutine.cc @@ -2,9 +2,11 @@ using study::Coroutine; +Coroutine* Coroutine::current = nullptr; + void* Coroutine::get_current_task() { - return Coroutine::current ? Coroutine::current->get_task() : nullptr; + return current ? current->get_task() : nullptr; } void* Coroutine::get_task() diff --git a/study_coroutine.cc b/study_coroutine.cc index 12e9dad..35e7d4f 100644 --- a/study_coroutine.cc +++ b/study_coroutine.cc @@ -3,6 +3,8 @@ using study::PHPCoroutine; using study::Coroutine; +php_coro_task PHPCoroutine::main_task = {0}; + long PHPCoroutine::create(zend_fcall_info_cache *fci_cache, uint32_t argc, zval *argv) { php_coro_args php_coro_args; -- GitLab