class Data : GLib.Object {
    public int x;
    public Data(int x) {
        this.x = x;
    }
    ~Data() {
        stdout.printf("%i Data destroy \n", x);
    }
}


class Test {
    private string name;
    public ThreadPool<Data> pool;
    public Test() {
        this.pool = new ThreadPool<Data>(thread_func, 10, false);
    }
    ~Test() {
        stdout.printf("Test destroy!\n");
    }
    void thread_func(Data a) {
        stdout.printf("thread_func %d %s\n", a.x, this.name);
        a.unref ();
    }
}


int main() {
    Test test = new Test();
    {
      Data data = new Data(12);
      data.ref ();
      test.pool.push(data);
    }
    var loop = new MainLoop();
    loop.run();
    return 0;
}