ThreadPool assertion 'real->running' failed



Hi,

I'm practicing using GThreadPool. I get the CRITICAL level warning "assertion 'real->running' failed" sometimes when g_thread_pool_unprocessed() and g_thread_pool_push() are called. I googled around but found no explanations of this warning.

The program basically does the following. Each thread in the pool is handed a task. While performing the task, the thread might push new sub-tasks to the thread pool. The main program starts by pushing a single task to the pool, which will result in a few more sub-tasks, and then calls g_thread_pool_free(threadpool, FALSE, TRUE) immediately. The main thread is supposed to wait untill all tasks are finished if I understand correctly.

Last question, is GThreadPool thread-safe? Do I have to lock it?

Thanks.

--
Ning


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]