diff options
author | Koichi Sasada <[email protected]> | 2020-12-08 14:04:18 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2020-12-16 19:12:48 +0900 |
commit | a9a7f4d8b8ec30abc7a47ce700edc7209ae12279 (patch) | |
tree | bc0092b4e1643cc0889c53a0941319ecf76ae190 /ractor_core.h | |
parent | ddb93c3d64b8997c85f23c96a73ad0a9a7f82ad1 (diff) |
Ractor#receive_if to receive only matched messages
Instead of Ractor.receive, Ractor.receive_if can provide a pattern
by a block and you can choose the receiving message.
[Feature #17378]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3862
Diffstat (limited to 'ractor_core.h')
-rw-r--r-- | ractor_core.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ractor_core.h b/ractor_core.h index c97dfcc85f..daa652ebff 100644 --- a/ractor_core.h +++ b/ractor_core.h @@ -14,11 +14,13 @@ enum rb_ractor_basket_type { basket_type_copy, basket_type_move, basket_type_will, + basket_type_deleted, + basket_type_reserved, }; struct rb_ractor_basket { - enum rb_ractor_basket_type type; bool exception; + enum rb_ractor_basket_type type; VALUE v; VALUE sender; }; @@ -28,6 +30,8 @@ struct rb_ractor_queue { int start; int cnt; int size; + unsigned int serial; + unsigned int reserved_cnt; }; struct rb_ractor_waiting_list { @@ -76,7 +80,7 @@ struct rb_ractor_sync { struct rb_ractor_struct { struct rb_ractor_sync sync; - + VALUE receiving_mutex; bool yield_atexit; // vm wide barrier synchronization |