g-wrap-dev
[Top][All Lists]
Advanced

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

[PATCH] only leave guile-mode when told to


From: Andy Wingo
Subject: [PATCH] only leave guile-mode when told to
Date: Thu, 04 Jan 2007 21:54:48 -0000

There's a problem with the recent leave-guile-mode patch. Basically,
sometimes we want to leave guile mode, and sometimes we don't.

Examples of times when we want to leave guile mode would be:

  g_main_loop_run ()

  gst_bus_poll()

  *any function* that can potentially cause a callback to come in from
  another thread, because guile needs to grab some kind of shared lock
  when adding a thread

Examples when you don't want to leave guile mode:

  functions that deal in SCM

  functions that call libguile code

So we have to choose a default. I propose that by default we stay in
guile mode, like we had before. Users that want threads have to deal
with the pain of manually telling g-wrap to leave guile-mode for the
functions.

I will set up guile-gnome to leave guile mode by default, with the
possibility of some kwarg to stay in.

So, how to implement this? The problem is that gw_wrapset_add_function
is generic, for all languages. The same with wrap-function!. The
<gw-function> and GWFunctionInfo both need to know whether or not to
leave guile-mode. Since a runtime seems like a normal thing for a
language to have, I propose including this bit in core g-wrap.

Concretely I propose adding a "flags" member tothe GWFunctionInfo and
<gw-function> data structures and a "flags" argument to the
wrap-function! and gw_wrapset_add_function procedures.

The attached bundle implements this behavior.

Thanks,

Andy.

Attachment: optionally-leave-guile-mode.bundle
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]