提交 ccbe6c44 编写于 作者: C codinghuang

delete the end_

上级 685bb19d
...@@ -23,7 +23,6 @@ protected: ...@@ -23,7 +23,6 @@ protected:
char* stack_; char* stack_;
uint32_t stack_size_; uint32_t stack_size_;
void *private_data_; void *private_data_;
bool end_;
}; };
} }
......
...@@ -6,7 +6,6 @@ using namespace Study; ...@@ -6,7 +6,6 @@ using namespace Study;
Context::Context(size_t stack_size, coroutine_func_t fn, void* private_data) : Context::Context(size_t stack_size, coroutine_func_t fn, void* private_data) :
fn_(fn), stack_size_(stack_size), private_data_(private_data) fn_(fn), stack_size_(stack_size), private_data_(private_data)
{ {
end_ = false;
swap_ctx_ = nullptr; swap_ctx_ = nullptr;
stack_ = (char*) malloc(stack_size_); stack_ = (char*) malloc(stack_size_);
...@@ -31,6 +30,5 @@ void Context::context_func(void *arg) ...@@ -31,6 +30,5 @@ void Context::context_func(void *arg)
{ {
Context *_this = (Context *) arg; Context *_this = (Context *) arg;
_this->fn_(_this->private_data_); _this->fn_(_this->private_data_);
_this->end_ = true;
_this->swap_out(); _this->swap_out();
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册