Re: Re: Help with callbacks
Roger Corman <[email protected]> Wed, 11 Jun 2003 12:45:38 -0700
| Newsgroups | gmane.lisp.corman |
|---|---|
| Message-ID | <[email protected]> |
Something to note: Lisp code may never be called on a thread that the lisp system does not know about. If it is being called on a previously unknown thread it will definitely be a problem. You could use BlessThread() to initialize a foreign-allocated thread for Lisp usage. The callbacks have definitely been used with multiple arguments. Chris's suggestion about declarations matching up (:pascal vs. :c conventions) is a good one. Check that, because it may cause a problem to show up with differing numbers of arguments. Roger At 05:15 AM 6/11/2003 +0000, you wrote: >--- 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 > > > > >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/ ------------------------ Yahoo! Groups Sponsor ---------------------~--> Looking for the latest Free IT White Papers? Visit SearchSecurity.com to access over 500 white papers. Get instant access at SearchSecurity.com Today http://us.click.yahoo.com/.lAzoD/QLNGAA/witMAA/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/