diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-09 14:45:56 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-09 14:45:56 +0000 |
commit | 1fdbe0f437de59f87527818918b55d794a5fb92d (patch) | |
tree | 5debf417488a6637ce9fd12074e744fe24c73722 /thread.c | |
parent | 50a058b6beb55998b6d06b912bb8ffeb9131e6af (diff) | |
download | ruby-1fdbe0f437de59f87527818918b55d794a5fb92d.tar.gz |
* gc.c (rb_objspace_call_finalizer): use rb_typeddata_is_kind_of() for
type check to get rid of a double free when main Thread has singleton
class. [ruby-core:36741] [Bug #4828]
* thread.c (rb_obj_is_mutex): add a new utility function.
* vm.c (rb_obj_is_thread): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -3350,6 +3350,17 @@ static const rb_data_type_t mutex_data_type = { {mutex_mark, mutex_free, mutex_memsize,}, }; +VALUE +rb_obj_is_mutex(VALUE obj) +{ + if (rb_typeddata_is_kind_of(obj, &mutex_data_type)) { + return Qtrue; + } + else { + return Qfalse; + } +} + static VALUE mutex_alloc(VALUE klass) { |