chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Calling out to C causing hang


From: Chris Double
Subject: Re: [Chicken-users] Calling out to C causing hang
Date: Tue, 8 Apr 2003 00:56:15 +1200
User-agent: KMail/1.4.3

On Tue, 08 Apr 2003 00:49, you wrote:
>
> BTW, your call-out to C does not perform callbacks, right?

Yes it does. Here's the code I'm calling from Scheme.

void do_event(Display* display)
{
  XEvent event;
  int i = C_interrupts_enabled;
  /* C_interrupts_enabled = 0; */
  if(XPending(display))
        {
          XNextEvent(display, &event);
          /* call_handle_event is a Scheme function. If an interrupt occurs
             while in there the programs hangs due to constantly performing 
             a minor gc */
          call_handle_event(get_base_window(event.xany.window), event.type);
        } 
  /*  C_interrupts_enabled = i; */
}

The call_handle_event is a scheme function:

  (define-external (call_handle_event (c-pointer w) (unsigned-long type)) void  
 
     ...)

If I wrap the function in the C_interrupts_enabled/disabled (ie. uncomment the 
relevant lines above) things seem to work fine. This is because 
handle_interrupts never gets called I assume. 

From your question I'm guessing that there might be a problem with calling 
back to scheme?

Chris.




reply via email to

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