James Henstridge <[EMAIL PROTECTED]> writes:

> You should be able to use python threading without problems.  Just
> remember that you have to acquire the GTK thread lock with
> threads_enter(), and release it with threads_leave() afterwards, when you
> do any GTK calls.
> 
> Note that you don't need to acquire the gtk thread lock from within signal
> handlers, but do have to from within timeout, idle and IO callback
> functions.

That's a very funny trap that I've been running into 2 hours ago... ;)

When a signal has been recorded by the python interpreter
(asynchronously), and the next thing which is being run is a timeout
handler, then the python signal handler is being run on entry into the
interpreter, which is then in the context of a timeout.

Is there any good way to find out if the code is excuted in the
timeout context (needs locking) or in a normal context? My solution
was to redefine mainloop() to call threads_leave() after each exit of
the gtk_main. This works since my program is single-threaded anyhow.

ciao
Andreas
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Reply via email to