Permalink
Browse files

Add typedef for thread list

  • Loading branch information...
1 parent d2895ab commit 981a596911820d669e34a998bbc98ec91c4b08db @dbussink dbussink committed Feb 2, 2014
Showing with 24 additions and 21 deletions.
  1. +5 −5 vm/agent_components.cpp
  2. +2 −2 vm/gc/baker.cpp
  3. +2 −2 vm/gc/gc.cpp
  4. +3 −2 vm/gc/gc.hpp
  5. +2 −2 vm/gc/immix.cpp
  6. +1 −1 vm/gc/walker.cpp
  7. +3 −3 vm/object_memory.cpp
  8. +1 −1 vm/object_memory.hpp
  9. +1 −1 vm/shared_state.cpp
  10. +4 −2 vm/shared_state.hpp
View
@@ -289,13 +289,13 @@ namespace agent {
virtual void read(Output& output) {
state_->shared().stop_threads_externally();
- std::list<ManagedThread*>* threads = state_->shared().threads();
+ ThreadList* threads = state_->shared().threads();
output.ok("value");
output.e().write_tuple(threads->size());
- for(std::list<ManagedThread*>::iterator i = threads->begin();
+ for(ThreadList::iterator i = threads->begin();
i != threads->end();
++i) {
if(VM* vm = (*i)->as_vm()) {
@@ -325,11 +325,11 @@ namespace agent {
output.ok("list");
- std::list<ManagedThread*>* thrs = state_->shared().threads();
+ ThreadList* thrs = state_->shared().threads();
output.e().write_tuple(thrs->size());
- for(std::list<ManagedThread*>::iterator i = thrs->begin();
+ for(ThreadList::iterator i = thrs->begin();
i != thrs->end();
++i) {
ManagedThread* thr = *i;
@@ -374,7 +374,7 @@ namespace agent {
output.ok("value");
- std::list<ManagedThread*>* thrs = state_->shared().threads();
+ ThreadList* thrs = state_->shared().threads();
output.e().write_integer(thrs->size());
View
@@ -192,7 +192,7 @@ namespace rubinius {
}
if(data->threads()) {
- for(std::list<ManagedThread*>::iterator i = data->threads()->begin();
+ for(ThreadList::iterator i = data->threads()->begin();
i != data->threads()->end();
++i) {
scan(*i, true);
@@ -272,7 +272,7 @@ namespace rubinius {
// Remove unreachable locked objects still in the list
if(data->threads()) {
- for(std::list<ManagedThread*>::iterator i = data->threads()->begin();
+ for(ThreadList::iterator i = data->threads()->begin();
i != data->threads()->end();
++i) {
clean_locked_objects(*i, true);
View
@@ -339,7 +339,7 @@ namespace rubinius {
void GarbageCollector::verify(GCData* data) {
if(data->threads()) {
- for(std::list<ManagedThread*>::iterator i = data->threads()->begin();
+ for(ThreadList::iterator i = data->threads()->begin();
i != data->threads()->end();
++i) {
ManagedThread* thr = *i;
@@ -396,7 +396,7 @@ namespace rubinius {
void GarbageCollector::scan_fibers(GCData* data, bool marked_only) {
if(data->threads()) {
- for(std::list<ManagedThread*>::iterator i = data->threads()->begin();
+ for(ThreadList::iterator i = data->threads()->begin();
i != data->threads()->end();
++i) {
if(VM* vm = (*i)->as_vm()) {
View
@@ -5,6 +5,7 @@
#include "oop.hpp"
#include "builtin/object.hpp"
+#include "shared_state.hpp"
namespace rubinius {
@@ -32,7 +33,7 @@ namespace rubinius {
capi::Handles* handles_;
std::list<capi::Handle*>* cached_handles_;
GlobalCache* global_cache_;
- std::list<ManagedThread*>* threads_;
+ ThreadList* threads_;
std::list<capi::GlobalHandle*>* global_handle_locations_;
#ifdef ENABLE_LLVM
LLVMState* llvm_state_;
@@ -49,7 +50,7 @@ namespace rubinius {
return roots_;
}
- std::list<ManagedThread*>* threads() {
+ ThreadList* threads() {
return threads_;
}
View
@@ -167,7 +167,7 @@ namespace rubinius {
}
if(data->threads()) {
- for(std::list<ManagedThread*>::iterator i = data->threads()->begin();
+ for(ThreadList::iterator i = data->threads()->begin();
i != data->threads()->end();
++i) {
scan(*i, false);
@@ -260,7 +260,7 @@ namespace rubinius {
// Remove unreachable locked objects still in the list
if(data->threads()) {
- for(std::list<ManagedThread*>::iterator i = data->threads()->begin();
+ for(ThreadList::iterator i = data->threads()->begin();
i != data->threads()->end();
++i) {
clean_locked_objects(*i, false);
View
@@ -37,7 +37,7 @@ namespace rubinius {
}
if(data.threads()) {
- for(std::list<ManagedThread*>::iterator i = data.threads()->begin();
+ for(ThreadList::iterator i = data.threads()->begin();
i != data.threads()->end();
++i) {
scan(*i, false);
View
@@ -579,7 +579,7 @@ namespace rubinius {
data->global_cache()->prune_young();
if(data->threads()) {
- for(std::list<ManagedThread*>::iterator i = data->threads()->begin();
+ for(ThreadList::iterator i = data->threads()->begin();
i != data->threads()->end();
++i) {
gc::Slab& slab = (*i)->local_slab();
@@ -795,9 +795,9 @@ namespace rubinius {
handles->deallocate_handles(cached, mark(), young);
}
- void ObjectMemory::clear_fiber_marks(std::list<ManagedThread*>* threads) {
+ void ObjectMemory::clear_fiber_marks(ThreadList* threads) {
if(threads) {
- for(std::list<ManagedThread*>::iterator i = threads->begin();
+ for(ThreadList::iterator i = threads->begin();
i != threads->end();
++i) {
if(VM* vm = (*i)->as_vm()) {
View
@@ -368,7 +368,7 @@ namespace rubinius {
void validate_handles(capi::Handles* handles);
void prune_handles(capi::Handles* handles, std::list<capi::Handle*>* cached, BakerGC* young);
- void clear_fiber_marks(std::list<ManagedThread*>* threads);
+ void clear_fiber_marks(ThreadList* threads);
ObjectPosition validate_object(Object* obj);
View
@@ -142,7 +142,7 @@ namespace rubinius {
SYNC_TL;
Array* threads = Array::create(state, 0);
- for(std::list<ManagedThread*>::iterator i = threads_.begin();
+ for(ThreadList::iterator i = threads_.begin();
i != threads_.end();
++i) {
if(VM* vm = (*i)->as_vm()) {
View
@@ -62,6 +62,8 @@ namespace rubinius {
typedef std::vector<std::string> CApiConstantNameMap;
typedef std_unordered_map<int, capi::Handle*> CApiConstantHandleMap;
+ typedef std::list<ManagedThread*> ThreadList;
+
/**
* SharedState represents the global shared state that needs to be shared
* across all VM instances.
@@ -83,7 +85,7 @@ namespace rubinius {
CApiConstantHandleMap capi_constant_handle_map_;
WorldState* world_;
- std::list<ManagedThread*> threads_;
+ ThreadList threads_;
uint64_t method_count_;
unsigned int class_count_;
@@ -172,7 +174,7 @@ namespace rubinius {
VM* new_vm();
void remove_vm(VM*);
- std::list<ManagedThread*>* threads() {
+ ThreadList* threads() {
return &threads_;
}

0 comments on commit 981a596

Please sign in to comment.