>Just curious, what is the point of the threads_enter & threads_leave
>API if everything breaks outside of the main thread? Isn't even
>providing them asking for misunderstandings like this?

You can replace the locking primitives Clutter uses through

  clutter_threads_set_lock_functions()

And use, for instance, a re-entrant lock.

Mostly, enter/leave are meant for language bindings and integration
libraries, to "enslave" the Clutter lock to another locking system; The
Python bindings, for instance, cannot use the clutter_threads_add_* API and
must reimplement it in order to take the interpreter lock as well. Without
clutter_threads_enter() and clutter_threads_leave() in the public API this
would not be possible.

Also, on Linux it's possible to use them (as I said) to mark a critical
section; if you don't care about portability then it's something you can use
- though it's discouraged and an unfortunate accident involving a bucket of
puppies and a belt sander might happen if you don't follow the established
"worker-thread-sends-results-in-idle" pattern.

Ciao,
 Emmanuele.

-- 
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com

Reply via email to