mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	Document how to handle kill/terminate interrupts in Thread.handle_interrupt
The kill/terminate interrupts are internally handled not as Exception instances, but as integers. So using Exception doesn't handle these interrupts, but Object does. You can use Integer if you only want to handle kill/terminate interrupts, but that's probably more of an implementation detail, while handling Object should work regardless of the implementation. Fixes [Bug #15735]
This commit is contained in:
		
							parent
							
								
									0395aa6bbb
								
							
						
					
					
						commit
						5c4ff3f00c
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		
							
								
								
									
										2
									
								
								thread.c
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								thread.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -2223,6 +2223,8 @@ handle_interrupt_arg_check_i(VALUE key, VALUE val, VALUE args)
 | 
			
		|||
 *     # all exceptions inherited from Exception are prohibited.
 | 
			
		||||
 *   }
 | 
			
		||||
 *
 | 
			
		||||
 * For handling all interrupts, use +Object+ and not +Exception+
 | 
			
		||||
 * as the ExceptionClass, as kill/terminate interrupts are not handled by +Exception+.
 | 
			
		||||
 */
 | 
			
		||||
static VALUE
 | 
			
		||||
rb_thread_s_handle_interrupt(VALUE self, VALUE mask_arg)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue