Re: Updating the contents of a treemodel from another thread.



Ok, I've got that part working. Now I have the problem that I need to
exit the thread gracefully if a new set of thumbnails is requested and
the thread is still running. Getting it to terminate gracefully and
resetting the queue is not very difficult and I get it to terminate
before the new thread is started (using a Cond), however, the
get_next_thumb() function keeps accessing the queue because (I presume)
there is still a number of outstanding signals left that it has to
handle (at least one) and I get a double lock on the mutex.

I've tried bools, further dispatchers that are called when the thread is
being terminated and when the termination is finished (they trigger a
bool switch on the receiver end which prevents the next_thumb_ready
signal from being acted upon) and Glib::Cond's and I still get deadlocks
or segfaults when launching the new thread.

Any ideas on how to keep that get_next_thumb() function from accessing
the queue in a thread safe manner?

Thanks.

-Bartek



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