diff options
| author | Tom Tromey | 2013-08-27 13:06:17 -0600 |
|---|---|---|
| committer | Tom Tromey | 2013-08-27 13:06:17 -0600 |
| commit | 44586142ad519003abe97e66b3cea0f6bbb020c2 (patch) | |
| tree | b02112a07236f77410ee2edf317f9c90baabf14c | |
| parent | 8c46d17826ae89bfa22b5e8048c013c0e3a38b2d (diff) | |
| download | emacs-44586142ad519003abe97e66b3cea0f6bbb020c2.tar.gz emacs-44586142ad519003abe97e66b3cea0f6bbb020c2.zip | |
zap until-condition
| -rw-r--r-- | lisp/subr.el | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index e8bbbb675fc..17289ef3ce9 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -4788,20 +4788,6 @@ This is the simplest safe way to acquire and release a mutex." | |||
| 4788 | (progn ,@body) | 4788 | (progn ,@body) |
| 4789 | (mutex-unlock ,sym))))) | 4789 | (mutex-unlock ,sym))))) |
| 4790 | 4790 | ||
| 4791 | (defmacro until-condition (test condition) | ||
| 4792 | "Wait for the condition variable CONDITION, checking TEST. | ||
| 4793 | Acquire CONDITION's mutex, then check TEST. | ||
| 4794 | If TEST evaluates to nil, repeatedly invoke `condition-wait' on CONDITION. | ||
| 4795 | When CONDITION is signalled, check TEST again. | ||
| 4796 | |||
| 4797 | This is the simplest safe way to invoke `condition-wait'." | ||
| 4798 | (let ((cond-sym (make-symbol "condition"))) | ||
| 4799 | `(let ((,cond-sym ,condition)) | ||
| 4800 | (with-mutex (condition-mutex ,cond-sym) | ||
| 4801 | (while (not ,test) | ||
| 4802 | (condition-wait ,cond-sym)))))) | ||
| 4803 | |||
| 4804 | |||
| 4805 | 4791 | ||
| 4806 | ;;; Misc. | 4792 | ;;; Misc. |
| 4807 | (defconst menu-bar-separator '("--") | 4793 | (defconst menu-bar-separator '("--") |