From 2b849eb5245f09cf6a417130160d818a8bc6baee Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Fri, 30 Oct 2015 23:06:14 -0400 Subject: [PATCH] Temporarily removing pthread calls --- gc.c | 24 ++++++++++++------------ include/cyclone/types.h | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/gc.c b/gc.c index 513163eb..915d44f1 100644 --- a/gc.c +++ b/gc.c @@ -488,14 +488,14 @@ void gc_mark_gray(gc_thread_data *thd, object obj) // either object type or mark. Both should be stable once the object is placed // into the heap, with the collector being the only thread that changes marks. if (is_object_type(obj) && mark(obj) == gc_color_clear) { // TODO: sync?? - // TODO: lock mark buffer (not ideal, but a possible first step)? - pthread_mutex_lock(&(thd->lock)); - thd->mark_buffer = vpbuffer_add(thd->mark_buffer, - &(thd->mark_buffer_len), - thd->last_write, - obj); - pthread_mutex_unlock(&(thd->lock)); - ATOMIC_INC(&(thd->last_write)); +//TODO: // TODO: lock mark buffer (not ideal, but a possible first step)? +//TODO: pthread_mutex_lock(&(thd->lock)); +//TODO: thd->mark_buffer = vpbuffer_add(thd->mark_buffer, +//TODO: &(thd->mark_buffer_len), +//TODO: thd->last_write, +//TODO: obj); +//TODO: pthread_mutex_unlock(&(thd->lock)); +//TODO: ATOMIC_INC(&(thd->last_write)); } } @@ -668,10 +668,10 @@ void gc_thread_data_init(gc_thread_data *thd) thd->last_read = 0; thd->mark_buffer_len = 128; thd->mark_buffer = vpbuffer_realloc(thd->mark_buffer, &(thd->mark_buffer_len)); - if (pthread_mutex(&(thd->lock), NULL) != 0) { - fprintf(stderr, "Unable to initialize thread mutex\n"); - exit(1); - } +// TODO: if (pthread_mutex(&(thd->lock), NULL) != 0) { +// TODO: fprintf(stderr, "Unable to initialize thread mutex\n"); +// TODO: exit(1); +// TODO: } } //// Unit testing: diff --git a/include/cyclone/types.h b/include/cyclone/types.h index ae9e3b3a..81dd121d 100644 --- a/include/cyclone/types.h +++ b/include/cyclone/types.h @@ -16,7 +16,7 @@ #include #include #include -#include +// TODO: #include /* Define general object type. */ typedef void *object; @@ -33,7 +33,7 @@ struct gc_thread_data_t { int last_read; void **mark_buffer; int mark_buffer_len; - pthread_mutex_t lock; +// TODO: pthread_mutex_t lock; }; /* GC data structures */