From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.devel Subject: [PATCH 3/3] new test case for I/O switching Date: Wed, 15 Aug 2012 08:49:58 -0600 Message-ID: <87393ow6p5.fsf@fleche.redhat.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1345042216 29933 80.91.229.3 (15 Aug 2012 14:50:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 15 Aug 2012 14:50:16 +0000 (UTC) To: Emacs discussions Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 15 16:50:17 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T1evF-0001pk-Jx for ged-emacs-devel@m.gmane.org; Wed, 15 Aug 2012 16:50:13 +0200 Original-Received: from localhost ([::1]:37131 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1evE-0000JA-KA for ged-emacs-devel@m.gmane.org; Wed, 15 Aug 2012 10:50:12 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1ev7-0000Fb-9w for emacs-devel@gnu.org; Wed, 15 Aug 2012 10:50:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1ev2-0003aR-Gn for emacs-devel@gnu.org; Wed, 15 Aug 2012 10:50:05 -0400 Original-Received: from mx1.redhat.com ([209.132.183.28]:35397) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1ev2-0003aJ-8M for emacs-devel@gnu.org; Wed, 15 Aug 2012 10:50:00 -0400 Original-Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7FEnxCO007405 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 15 Aug 2012 10:49:59 -0400 Original-Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q7FEnwAL025109 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 15 Aug 2012 10:49:59 -0400 X-Attribution: Tom User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:152556 Archived-At: 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