X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Funix.lisp;h=1e973f33b7b0104d96a8886266e40d8a7dd6de6a;hb=df679ed627975948b1cee190f4d79c397588c43e;hp=4dce234153bbf9438074fd0824d7a839a4d3d07b;hpb=b387f6ae447b55e203f47fc40af4a36e756fe345;p=sbcl.git diff --git a/src/code/unix.lisp b/src/code/unix.lisp index 4dce234..1e973f3 100644 --- a/src/code/unix.lisp +++ b/src/code/unix.lisp @@ -760,13 +760,11 @@ (slot (slot itvo 'it-value) 'tv-usec)) which (alien-sap (addr itvn))(alien-sap (addr itvo)))))) -(defmacro with-timeout (expires &body body) +(defmacro sb!ext::with-timeout (expires &body body) "Execute the body, interrupting it with a SIGALRM after at least EXPIRES seconds have passed. Uses Unix setitimer(), restoring any previous timer after the body has finished executing" - (let ((saved-seconds (gensym "SAVED-SECONDS")) - (saved-useconds (gensym "SAVED-USECONDS")) - (s (gensym "S")) (u (gensym "U"))) + (with-unique-names (saved-seconds saved-useconds s u) `(let (- ,saved-seconds ,saved-useconds) (multiple-value-setq (- - - ,saved-seconds ,saved-useconds) (unix-getitimer :real))