Re: threads lock up desktop



"Nils O. Selåsdal" <noselasd frisurf no> writes:

Looking at the FAQ I should use the 
g_thread_init(NULL),gdk_threads_enter(),gdk_threads_leave();
mechanisms when writing a multithreaded app.

Now, I want to write a function that calls
gdk_threads_enter() and gdk_threads_leave() ,that function 
might be called from the mainloop or from another thread . 
Can I do that?

My entire desktop locks up when i call gdk_threads_enter() 
from the main loop...

You simply can't have functions that can be called both
with or without the GDK lock, so you need to decide in
which category your function lies, and code accordingly.

Regards,
                                        Owen

(It's generally pretty much needed for any thread programming
to know what locks you have at every point in your code ..
if you don't know that information, it's hard to avoid
deadlocks.)





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