unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Emacs discussions <emacs-devel@gnu.org>
Subject: [PATCH 3/3] new test case for I/O switching
Date: Wed, 15 Aug 2012 08:49:58 -0600	[thread overview]
Message-ID: <87393ow6p5.fsf@fleche.redhat.com> (raw)

This adds a new test case that demonstrates that Emacs task-switches
while waiting for I/O.

---
 test/automated/threads.el |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/test/automated/threads.el b/test/automated/threads.el
index b09e269..4c1afbd 100644
--- a/test/automated/threads.el
+++ b/test/automated/threads.el
@@ -162,4 +162,17 @@
        (thread-join thr))
      t)))
 
+(defun threads-test-io-switch ()
+  (setq threads-test-global 23))
+
+(ert-deftest threads-io-switch ()
+  "test that accept-process-output causes thread switch"
+  (should
+   (progn
+     (setq threads-test-global nil)
+     (make-thread #'threads-test-io-switch)
+     (while (not threads-test-global)
+       (accept-process-output nil 1))
+     threads-test-global)))
+
 ;;; threads.el ends here
-- 
1.7.7.6




             reply	other threads:[~2012-08-15 14:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-15 14:49 Tom Tromey [this message]
2012-08-15 16:07 ` [PATCH 3/3] new test case for I/O switching Stefan Monnier
2012-08-15 19:40   ` Tom Tromey
2012-08-16  2:05     ` Stefan Monnier
2012-08-16 15:01       ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87393ow6p5.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).