darling-libobjc2/hash_table.c

20 lines
415 B
C
Raw Normal View History

#include "objc/toydispatch.h"
#include "lock.h"
2010-02-01 14:48:40 +00:00
static dispatch_queue_t garbage_queue;
void objc_collect_garbage_data(void(*cleanup)(void*), void *garbage)
{
if (0 == garbage_queue)
{
LOCK(__objc_runtime_mutex);
if (0 == garbage_queue)
{
garbage_queue = dispatch_queue_create("ObjC deferred free queue", 0);
}
UNLOCK(__objc_runtime_mutex);
}
2010-02-01 14:48:40 +00:00
dispatch_async_f(garbage_queue, garbage, cleanup);
}