-
-static void
-cleanup_monitor(void *unused)
-{
- struct monitor *last_ptr = NULL;
- struct monitor *next_ptr, *ptr;
- int i;
-
- for(i = 0; i < MONITOR_HASH_SIZE; i++)
- {
- last_ptr = NULL;
- for(ptr = monitorTable[i]; ptr; ptr = next_ptr)
- {
- next_ptr = ptr->hnext;
-
- if(!rb_dlink_list_length(&ptr->users))
- {
- if(last_ptr)
- last_ptr->hnext = next_ptr;
- else
- monitorTable[i] = next_ptr;
-
- BlockHeapFree(monitor_heap, ptr);
- }
- else
- last_ptr = ptr;
- }
- }
-}