-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To make some kind of Ractor related extensions, some functions should be exposed. * include/ruby/thread_native.h * rb_native_mutex_* * rb_native_cond_* * include/ruby/ractor.h * RB_OBJ_SHAREABLE_P(obj) * rb_ractor_shareable_p(obj) * rb_ractor_std*() * rb_cRactor and rm ractor_pub.h and rename srcdir/ractor.h to srcdir/ractor_core.h (to avoid conflict with include/ruby/ractor.h)
- Loading branch information
Showing
23 changed files
with
120 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#ifndef RUBY_RACTOR_H | ||
#define RUBY_RACTOR_H 1 | ||
|
||
/** | ||
* @file | ||
* @author Koichi Sasada | ||
* @date Tue Nov 17 16:39:15 2020 | ||
* @copyright Copyright (C) 2020 Yukihiro Matsumoto | ||
* @copyright This file is a part of the programming language Ruby. | ||
* Permission is hereby granted, to either redistribute and/or | ||
* modify this file, provided that the conditions mentioned in the | ||
* file COPYING are met. Consult the file for details. | ||
*/ | ||
|
||
RUBY_SYMBOL_EXPORT_BEGIN | ||
RUBY_EXTERN VALUE rb_cRactor; | ||
|
||
VALUE rb_ractor_stdin(void); | ||
VALUE rb_ractor_stdout(void); | ||
VALUE rb_ractor_stderr(void); | ||
void rb_ractor_stdin_set(VALUE); | ||
void rb_ractor_stdout_set(VALUE); | ||
void rb_ractor_stderr_set(VALUE); | ||
|
||
bool rb_ractor_shareable_p_continue(VALUE obj); // do not call it directly. | ||
|
||
RUBY_SYMBOL_EXPORT_END | ||
|
||
#define RB_OBJ_SHAREABLE_P(obj) FL_TEST_RAW((obj), RUBY_FL_SHAREABLE) | ||
|
||
static inline bool | ||
rb_ractor_shareable_p(VALUE obj) | ||
{ | ||
if (SPECIAL_CONST_P(obj)) { | ||
return true; | ||
} | ||
else if (RB_OBJ_SHAREABLE_P(obj)) { | ||
return true; | ||
} | ||
else { | ||
return rb_ractor_shareable_p_continue(obj); | ||
} | ||
} | ||
|
||
#endif /* RUBY_RACTOR_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.