mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	
							parent
							
								
									2e6e2fd9da
								
							
						
					
					
						commit
						397a509b6d
					
				
				
				Notes:
				
					git
				
				2021-12-15 02:33:36 +09:00 
				
			
			
			
		
		
					 2 changed files with 15 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -211,6 +211,17 @@ assert_equal '[:a, :b, :c, :d, :e, :f, :g]', %q{
 | 
			
		|||
  Ractor.make_shareable(closure).call
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Now autoload in non-main Ractor is not supported
 | 
			
		||||
assert_equal 'ok', %q{
 | 
			
		||||
  autoload :Foo, 'foo.rb'
 | 
			
		||||
  r = Ractor.new do
 | 
			
		||||
    p Foo
 | 
			
		||||
  rescue Ractor::UnsafeError
 | 
			
		||||
    :ok
 | 
			
		||||
  end
 | 
			
		||||
  r.take
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
###
 | 
			
		||||
###
 | 
			
		||||
# Ractor still has several memory corruption so skip huge number of tests
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2553,6 +2553,10 @@ rb_autoload_load(VALUE mod, ID id)
 | 
			
		|||
    src = rb_sourcefile();
 | 
			
		||||
    if (src && loading && strcmp(src, loading) == 0) return Qfalse;
 | 
			
		||||
 | 
			
		||||
    if (UNLIKELY(!rb_ractor_main_p())) {
 | 
			
		||||
        rb_raise(rb_eRactorUnsafeError, "require by autoload on non-main Ractor is not supported (%s)", rb_id2name(id));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if ((ce = rb_const_lookup(mod, id))) {
 | 
			
		||||
        flag = ce->flag & (CONST_DEPRECATED | CONST_VISIBILITY_MASK);
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue