Skip to content
  • nagachika's avatar
    a72b7b89
    merge revision(s)... · a72b7b89
    nagachika authored
    merge revision(s) d0d6227a,fff1edf2: [Backport #17529]
    
    	alen should be actions number on ractor_select()
    
    	alen was number of rs, but it should be actions number
    	(taking ractors + receiving + yielding).
    	---
    	 ractor.c | 13 ++++++-------
    	 1 file changed, 6 insertions(+), 7 deletions(-)
    
    	fix Ractor.yield(obj, move: true)
    
    	Ractor.yield(obj, move: true) and
    	Ractor.select(..., yield_value: obj, move: true) tried to yield a
    	value with move semantices, but if the trial is faild, the obj
    	should not become a moved object.
    
    	To keep this rule, `wait_moving` wait status is introduced.
    
    	New yield/take process:
    	(1) If a ractor tried to yield (move:true), make taking racotr's
    	    wait status `wait_moving` and make a moved object by
    	    `ractor_move(obj)` and wakeup taking ractor.
    	(2) If a ractor tried to take a message from a ractor waiting fo
    	    yielding (move:true), wakeup the ractor and wait for (1).
    	---
    	 bootstraptest/test_ractor.rb | 25 +++++++++++++++
    	 ractor.c                     | 73 +++++++++++++++++++++++++++++++++++---------
    	 ractor_core.h                |  1 +
    	 3 files changed, 84 insertions(+), 15 deletions(-)
    a72b7b89
    merge revision(s)...
    nagachika authored
    merge revision(s) d0d6227a,fff1edf2: [Backport #17529]
    
    	alen should be actions number on ractor_select()
    
    	alen was number of rs, but it should be actions number
    	(taking ractors + receiving + yielding).
    	---
    	 ractor.c | 13 ++++++-------
    	 1 file changed, 6 insertions(+), 7 deletions(-)
    
    	fix Ractor.yield(obj, move: true)
    
    	Ractor.yield(obj, move: true) and
    	Ractor.select(..., yield_value: obj, move: true) tried to yield a
    	value with move semantices, but if the trial is faild, the obj
    	should not become a moved object.
    
    	To keep this rule, `wait_moving` wait status is introduced.
    
    	New yield/take process:
    	(1) If a ractor tried to yield (move:true), make taking racotr's
    	    wait status `wait_moving` and make a moved object by
    	    `ractor_move(obj)` and wakeup taking ractor.
    	(2) If a ractor tried to take a message from a ractor waiting fo
    	    yielding (move:true), wakeup the ractor and wait for (1).
    	---
    	 bootstraptest/test_ractor.rb | 25 +++++++++++++++
    	 ractor.c                     | 73 +++++++++++++++++++++++++++++++++++---------
    	 ractor_core.h                |  1 +
    	 3 files changed, 84 insertions(+), 15 deletions(-)
Loading