Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Some minor locking cleanups

  • Loading branch information...
commit 43304bcad6a8dcc6897b04a9a3a8b84d488cc5e8 1 parent 424bba0
@evanphx evanphx authored
View
2  vm/gc/inflated_headers.cpp
@@ -26,6 +26,8 @@ namespace rubinius {
InflatedHeader* header = free_list_;
free_list_ = header->next();
+ header->clear();
+
in_use_++;
header->set_object(obj);
View
2  vm/objectmemory.cpp
@@ -382,8 +382,6 @@ namespace rubinius {
}
ih = inflated_headers_->allocate(obj);
- ih->flags().meaning = eAuxWordEmpty;
- ih->flags().aux_word = 0;
break;
case eAuxWordInflated:
if(cDebugThreading) {
View
9 vm/oop.cpp
@@ -594,6 +594,9 @@ namespace rubinius {
void InflatedHeader::set_object(ObjectHeader* obj) {
flags_ = obj->flags();
object_ = obj;
+
+ flags_.meaning = eAuxWordEmpty;
+ flags_.aux_word = 0;
}
void InflatedHeader::initialize_mutex(int thread_id, int count) {
@@ -650,7 +653,7 @@ namespace rubinius {
GCIndependent gc_guard(state);
if(cDebugThreading) {
- std::cerr << "[LOCK " << state->vm()->thread_id() << " locking native mutex]\n";
+ std::cerr << "[LOCK " << state->vm()->thread_id() << " locking native mutex: " << this << "]\n";
}
state->vm()->set_sleeping();
@@ -699,7 +702,7 @@ namespace rubinius {
state->vm()->add_locked_object(object_);
if(cDebugThreading) {
- std::cerr << "[LOCK " << state->vm()->thread_id() << " locked inflated header]\n";
+ std::cerr << "[LOCK " << state->vm()->thread_id() << " locked inflated header: " << this << "]\n";
}
return eLocked;
@@ -777,7 +780,7 @@ namespace rubinius {
owner_id_ = 0;
if(cDebugThreading) {
- std::cerr << "[LOCK " << state->vm()->thread_id() << " unlocked native]\n";
+ std::cerr << "[LOCK " << state->vm()->thread_id() << " unlocked native: " << this << "]\n";
}
} else {
rec_lock_count_--;
Please sign in to comment.
Something went wrong with that request. Please try again.