Re: Help with callbacks

"smallhairytroll" <[email protected]> Wed, 11 Jun 2003 23:55:28 -0000
Newsgroups gmane.lisp.corman
Message-ID <[email protected]>
--- In [email protected], Roger Corman <roger@c...> wrote:
> 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.

Hi Roger,

This is probably it then as both the timer and the thread callback 
fail (The thread callback is definitely called from a foreign 
thread). When you say "Lisp code may never be called on a thread", 
do you mean that an unknown foreign thread may never call a Lisp 
function, or that a Lisp function may never call an unknown thread 
(or both)?

Unfortunately calling BlessThread is not possible... Well, I suppose 
it is, it would just mean wrapping the BlessThread/UnBlessThread 
calls within #ifdef CORMAN_LISP and having the changes added to the 
main SDL source tree.

> 
> 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.

All SDL calls use the C calling convertion, even the callbacks. My 
FFI definitions use:

#! (:export t :library "SDL" :ignore "DECLSPEC" :pack 4)

The callback is defined using ct:defun-c-callback, which pretty much 
covers the C calling convertion, correct ?

It's good to finally get to the bottom of this. I am not terribly 
concerned with not being able to use the SDL functions for creating 
threads and timers as both can be implemented in Corman Lisp. Both 
SDL and Corman use OS native threads, so the SDL provided Semaphore 
and Mutex functions work just fine.

Thanks,
-Luke


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Looking for the latest Free IT White Papers?
Visit SearchNetworking.com to access over 500 white papers.
Get instant access at SearchNetworking.com Today
http://us.click.yahoo.com/8lAzoD/OLNGAA/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/