From: Daniel B. <da...@us...> - 2002-12-12 05:09:15
|
Update of /cvsroot/sbcl/sbcl/src/code In directory sc8-pr-cvs1:/tmp/cvs-serv7065/src/code Modified Files: Tag: dan_native_threads_branch target-thread.lisp Log Message: 0.7.9.54.thread.11 #+better-to-live-on-the-roof IItt rruunns!! Trivial foreign function bindings added to target-thread Make the SB!THREAD package slightly more useful (e.g. have it use some other packages) Ruminate a bit on API in TODO.dan Index: target-thread.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/code/Attic/target-thread.lisp,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -d -r1.1.2.4 -r1.1.2.5 --- target-thread.lisp 12 Dec 2002 03:16:47 -0000 1.1.2.4 +++ target-thread.lisp 12 Dec 2002 05:09:12 -0000 1.1.2.5 @@ -1,3 +1,16 @@ (in-package "SB!THREAD") +;; opaque type +(sb!alien:define-alien-type thread (struct thread-struct)) +(sb!alien::define-alien-routine ("init_thread" %init-thread) + (* thread) (lisp-fun-address sb!alien:unsigned-long)) + +(defun make-thread (function) + (%init-thread (sb!kernel:get-lisp-obj-address (coerce function 'function)))) + +#| +(defvar *foo* nil) +(defun thread-nnop () (loop (setf *foo* (not *foo*)) (sleep 1))) +(make-thread #'thread-nnop) +|# |