mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* lib/monitor.rb (wait): ensure reentrance.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									3c0af9ca44
								
							
						
					
					
						commit
						8eeaf69e52
					
				
					 2 changed files with 14 additions and 11 deletions
				
			
		| 
						 | 
					@ -1,3 +1,7 @@
 | 
				
			||||||
 | 
					Mon Apr  2 13:54:21 2001  Shugo Maeda <shugo@ruby-lang.org>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* lib/monitor.rb (wait): ensure reentrance.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Mon Apr  2 12:40:45 2001  Shugo Maeda <shugo@ruby-lang.org>
 | 
					Mon Apr  2 12:40:45 2001  Shugo Maeda <shugo@ruby-lang.org>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	* lib/net/imap.rb (media_subtype): return subtype.
 | 
						* lib/net/imap.rb (media_subtype): return subtype.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -93,21 +93,20 @@ module MonitorMixin
 | 
				
			||||||
      rescue Timeout
 | 
					      rescue Timeout
 | 
				
			||||||
	@waiters.delete(Thread.current)
 | 
						@waiters.delete(Thread.current)
 | 
				
			||||||
      ensure
 | 
					      ensure
 | 
				
			||||||
 | 
						Thread.critical = true
 | 
				
			||||||
	if timeout && timeout_thread.alive?
 | 
						if timeout && timeout_thread.alive?
 | 
				
			||||||
	  Thread.kill(timeout_thread)
 | 
						  Thread.kill(timeout_thread)
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
						while @monitor.mon_owner &&
 | 
				
			||||||
 | 
						    @monitor.mon_owner != Thread.current
 | 
				
			||||||
 | 
						  @monitor.mon_waiting_queue.push(Thread.current)
 | 
				
			||||||
 | 
						  Thread.stop
 | 
				
			||||||
 | 
						  Thread.critical = true
 | 
				
			||||||
 | 
						end
 | 
				
			||||||
 | 
						@monitor.mon_owner = Thread.current
 | 
				
			||||||
 | 
						@monitor.mon_count = count
 | 
				
			||||||
 | 
						Thread.critical = false
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
      
 | 
					 | 
				
			||||||
      Thread.critical = true
 | 
					 | 
				
			||||||
      while @monitor.mon_owner &&
 | 
					 | 
				
			||||||
	  @monitor.mon_owner != Thread.current
 | 
					 | 
				
			||||||
	@monitor.mon_waiting_queue.push(Thread.current)
 | 
					 | 
				
			||||||
	Thread.stop
 | 
					 | 
				
			||||||
	Thread.critical = true
 | 
					 | 
				
			||||||
      end
 | 
					 | 
				
			||||||
      @monitor.mon_owner = Thread.current
 | 
					 | 
				
			||||||
      @monitor.mon_count = count
 | 
					 | 
				
			||||||
      Thread.critical = false
 | 
					 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    def wait_while
 | 
					    def wait_while
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue