
#include <glib.h>
#include <gsf/gsf-utils.h>
#include <gsf/gsf-input-memory.h>

#define SIZE 100

static void thread_func(gpointer data, gpointer udata)
{
	g_object_unref(gsf_input_memory_new(g_malloc(SIZE), SIZE, TRUE));
}

int main(void)
{
	GThreadPool *tpool;
	gint i;

	g_thread_init(NULL);
	g_type_init();
	gsf_init();

	tpool = g_thread_pool_new(thread_func, NULL, -1, FALSE, NULL);

	for (i = 0; i < 100; ++i)
		g_thread_pool_push(tpool, GINT_TO_POINTER(-1), NULL);

	g_thread_pool_free(tpool, FALSE, TRUE);

	return 0;
}
