X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=gdk%2Fgdk.threads.lisp;h=5be774342a2e289c51f4e8b86488baed20ff3136;hb=cf71aff8f03ba5058775ac13f6e115f81a8c20cd;hp=268c05a9531d56ec037503b93de189ef1622737b;hpb=061cf59f4abaa71f92182ee8db56e023208718d0;p=cl-gtk2.git diff --git a/gdk/gdk.threads.lisp b/gdk/gdk.threads.lisp index 268c05a..5be7743 100644 --- a/gdk/gdk.threads.lisp +++ b/gdk/gdk.threads.lisp @@ -9,6 +9,15 @@ (defcfun gdk-threads-leave :void) (export 'gdk-threads-leave) +(defmacro with-gdk-threads-lock (&body body) + `(progn + (gdk-threads-enter) + (unwind-protect + (progn ,@body) + (gdk-threads-leave)))) +(export 'with-gdk-threads-lock) + +;; ignored: ;; void gdk_threads_set_lock_functions (GCallback enter_fn, ;; GCallback leave_fn);