Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E94FC7D05 for ; Mon, 15 Aug 2011 12:34:47 +0000 (UTC) Received: (qmail 10845 invoked by uid 500); 15 Aug 2011 12:34:46 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 10417 invoked by uid 500); 15 Aug 2011 12:34:41 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 10408 invoked by uid 99); 15 Aug 2011 12:34:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Aug 2011 12:34:39 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of theflycloud@126.com designates 220.181.15.84 as permitted sender) Received: from [220.181.15.84] (HELO m15-84.126.com) (220.181.15.84) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Aug 2011 12:34:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=Received:Date:From:To:Message-ID:Subject: MIME-Version:Content-Type; bh=wppO3Zc75m9iWIfuZysdjxoy72x0+HFGJI pP/TUAW6M=; b=oJEZHkg2u87fqjs8cxKmiKgdXQ3++6aVr7DWO/qFWufBvSY7Dv FE9Y/7tJULZvJEw0bxrFNNUmbFbew7Ov+8RZ7/dv/rPvZRMDr7AcfINnRhPU/smb E+AGvos/RFvvyIIhPgeENBuX9WzD+Jucq8Qj4tiF4NRHVcLXsDFMkrrFA= Received: from theflycloud ( [183.38.177.8] ) by ajax-webmail-wmsvr84 (Coremail) ; Mon, 15 Aug 2011 20:34:05 +0800 (CST) Date: Mon, 15 Aug 2011 20:34:05 +0800 (CST) From: =?GBK?B?0rbDrw==?= To: tomcat-dev-mlist Message-ID: <13efcde.51e3.131cd6f4160.Coremail.theflycloud@126.com> Subject: is this acceptor threadsafe? MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_68039_27289432.1313411645792" X-Originating-IP: [183.38.177.8] X-Priority: 3 X-Mailer: Coremail Webmail Server Version SP_ntes V3.5 build 110713(13936.3901.3890) Copyright (c) 2002-2011 www.mailtech.cn 126com X-CM-CTRLDATA: +DaBvGZvb3Rlcl9odG09MjQ2Nzo4MQ== X-CM-TRANSID: VMqowLCrqgA+EklOJGUYAA--.5895W X-CM-SenderInfo: hwkhwz51fo03bg6rjloofrz/1tbi6AWczk0vJztT0wACsD X-Coremail-Antispam: 1U5529EdanIXcx71UUUUU7vcSsGvfC2KfnxnUU== ------=_Part_68039_27289432.1313411645792 Content-Type: text/plain; charset=GBK Content-Transfer-Encoding: 7bit /** * Server socket acceptor thread. */ protected class Acceptor implements Runnable { /** * The background thread that listens for incoming TCP/IP connections and * hands them off to an appropriate processor. */ public void run() { // Loop until we receive a shutdown command while (running) { // Loop if endpoint is paused while (paused) { try { Thread.sleep(1000); } catch (InterruptedException e) { // Ignore } } try { // Accept the next incoming connection from the server socket SocketChannel socket = serverSock.accept(); if we have more than 1 acceptors,will the statement of "serverSock.accept()" be theadsafe? ------=_Part_68039_27289432.1313411645792--