Re: Help with callbacks

"smallhairytroll" <[email protected]> Wed, 11 Jun 2003 05:15:29 -0000
Newsgroups gmane.lisp.corman
Message-ID <[email protected]>
--- In [email protected], "Chris Double" 
<chris.double@d...> wrote:
> On Wed, 11 Jun 2003 02:09:43 -0000, "smallhairytroll"
> <lcluke@h...> said:
> > Good idea, unfortunately it still crashes. (I didn't bother 
calling 
> > SDL_PushEvent as it still crashes returning only interval.)
> 
> Two more things to try. What happens if you call SDL_AddTimer with 
the
> following:
> 
> (setf a-timer-1 (SDL_AddTimer 
>         500 
>         (ct:get-callback-procinst 'my-timer-func-1)
>         (ct:int-to-foreign-ptr 0)))
> 

Hi Chris,

Thanks for all your feedback, it is very much appreciated.

The above code either locks up CCL completely, or abrubtly 
terminates the environment. The previous crashes brought up the 
Windows dialog that asks to send details of the crash to Microsoft. 
Not so with this code.

I have already tried using ct:defun-c-callback and ct:defun-callback 
for C and Pascal calling convertions respectively. No difference.

Multiple timers require multiple threads and each timer is added to 
the Windows message queue using the Windows function: timeSetEvent

"The timeSetEvent function starts a specified timer event. The 
multimedia timer runs in its own thread. After the event is 
activated, it calls the specified callback function or sets or 
pulses the specified event object"

The callback function is HandleAlarm, which in turn calls 
SDL_ThreadedTimerCheck. This is the function that fires the Lisp 
callback function.

-Luke



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/SyjtlB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[email protected]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/