mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-04 03:36:34 +02:00
Added gc_is_mutator_active()
This commit is contained in:
parent
5e0fb7edc7
commit
64be028166
2 changed files with 13 additions and 0 deletions
12
gc.c
12
gc.c
|
@ -195,6 +195,18 @@ void gc_remove_mutator(gc_thread_data * thd)
|
|||
pthread_mutex_unlock(&mutators_lock);
|
||||
}
|
||||
|
||||
int gc_is_mutator_active(gc_thread_data *thd)
|
||||
{
|
||||
ck_array_iterator_t iterator;
|
||||
gc_thread_data *m;
|
||||
CK_ARRAY_FOREACH(&Cyc_mutators, &iterator, &m) {
|
||||
if (m == thd) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Free thread data for all terminated mutators
|
||||
*/
|
||||
|
|
|
@ -306,6 +306,7 @@ struct gc_thread_data_t {
|
|||
void gc_initialize(void);
|
||||
void gc_add_mutator(gc_thread_data * thd);
|
||||
void gc_remove_mutator(gc_thread_data * thd);
|
||||
int gc_is_mutator_active(gc_thread_data *thd);
|
||||
gc_heap *gc_heap_create(int heap_type, size_t size, size_t max_size,
|
||||
size_t chunk_size, gc_thread_data *thd);
|
||||
gc_heap *gc_heap_free(gc_heap *page, gc_heap *prev_page);
|
||||
|
|
Loading…
Add table
Reference in a new issue