Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
10f28fc8
Commit
10f28fc8
authored
Mar 02, 2018
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add `mrb_fiber_alive_p` to C API.
parent
a95b6d34
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
include/mruby.h
include/mruby.h
+7
-0
mrbgems/mruby-fiber/src/fiber.c
mrbgems/mruby-fiber/src/fiber.c
+3
-2
No files found.
include/mruby.h
View file @
10f28fc8
...
...
@@ -1225,6 +1225,13 @@ MRB_API mrb_value mrb_fiber_resume(mrb_state *mrb, mrb_value fib, mrb_int argc,
*/
MRB_API
mrb_value
mrb_fiber_yield
(
mrb_state
*
mrb
,
mrb_int
argc
,
const
mrb_value
*
argv
);
/*
* Check if a Fiber is alive
*
* @mrbgem mruby-fiber
*/
MRB_API
mrb_value
mrb_fiber_alive_p
(
mrb_state
*
mrb
,
mrb_value
fib
);
/*
* FiberError reference
*
...
...
mrbgems/mruby-fiber/src/fiber.c
View file @
10f28fc8
...
...
@@ -274,12 +274,13 @@ mrb_fiber_resume(mrb_state *mrb, mrb_value fib, mrb_int len, const mrb_value *a)
* Returns true if the fiber can still be resumed. After finishing
* execution of the fiber block this method will always return false.
*/
static
mrb_value
fiber_alive_p
(
mrb_state
*
mrb
,
mrb_value
self
)
MRB_API
mrb_value
mrb_
fiber_alive_p
(
mrb_state
*
mrb
,
mrb_value
self
)
{
struct
mrb_context
*
c
=
fiber_check
(
mrb
,
self
);
return
mrb_bool_value
(
c
->
status
!=
MRB_FIBER_TERMINATED
);
}
#define fiber_alive_p mrb_fiber_alive_p
static
mrb_value
fiber_eq
(
mrb_state
*
mrb
,
mrb_value
self
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment