mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* variable.c (classname): the name of class that has
non class id should not be nil. This bug was introduced in r36577. * test/thread/test_cv.rb: test for change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									0a4801e768
								
							
						
					
					
						commit
						113b1c76fc
					
				
					 3 changed files with 18 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -1,3 +1,11 @@
 | 
			
		|||
Sat Sep  7 13:49:40 2013  Kazuki Tsujimoto  <kazuki@callcc.net>
 | 
			
		||||
 | 
			
		||||
	* variable.c (classname): the name of class that has
 | 
			
		||||
	  non class id should not be nil. This bug was introduced
 | 
			
		||||
	  in r36577.
 | 
			
		||||
 | 
			
		||||
	* test/thread/test_cv.rb: test for change.
 | 
			
		||||
 | 
			
		||||
Sat Sep  7 13:29:22 2013  Kazuki Tsujimoto  <kazuki@callcc.net>
 | 
			
		||||
 | 
			
		||||
	* lib/find.rb (Find.find): respect the encodings of arguments.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -82,20 +82,23 @@ class TestConditionVariable < Test::Unit::TestCase
 | 
			
		|||
  end
 | 
			
		||||
 | 
			
		||||
  def test_condvar_wait_deadlock
 | 
			
		||||
    assert_in_out_err([], <<-INPUT, ["No live threads left. Deadlock?"], [])
 | 
			
		||||
    assert_in_out_err([], <<-INPUT, ["fatal", "No live threads left. Deadlock?"], [])
 | 
			
		||||
      require "thread"
 | 
			
		||||
 | 
			
		||||
      mutex = Mutex.new
 | 
			
		||||
      cv = ConditionVariable.new
 | 
			
		||||
 | 
			
		||||
      klass = nil
 | 
			
		||||
      mesg = nil
 | 
			
		||||
      begin
 | 
			
		||||
        mutex.lock
 | 
			
		||||
        cv.wait mutex
 | 
			
		||||
        mutex.unlock
 | 
			
		||||
      rescue Exception => e
 | 
			
		||||
        klass = e.class
 | 
			
		||||
        mesg = e.message
 | 
			
		||||
      end
 | 
			
		||||
      puts klass
 | 
			
		||||
      print mesg
 | 
			
		||||
INPUT
 | 
			
		||||
  end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -177,9 +177,14 @@ classname(VALUE klass, int *permanent)
 | 
			
		|||
		path = find_class_path(klass, (ID)0);
 | 
			
		||||
	    }
 | 
			
		||||
	    if (NIL_P(path)) {
 | 
			
		||||
		if (!cid || !st_lookup(RCLASS_IV_TBL(klass), (st_data_t)tmp_classpath, &n)) {
 | 
			
		||||
		if (!cid) {
 | 
			
		||||
		    return Qnil;
 | 
			
		||||
		}
 | 
			
		||||
		if (!st_lookup(RCLASS_IV_TBL(klass), (st_data_t)tmp_classpath, &n)) {
 | 
			
		||||
		    path = rb_str_dup(rb_id2str(cid));
 | 
			
		||||
		    OBJ_FREEZE(path);
 | 
			
		||||
		    return path;
 | 
			
		||||
		}
 | 
			
		||||
		*permanent = 0;
 | 
			
		||||
		path = (VALUE)n;
 | 
			
		||||
		return path;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue