⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 09-04.html

📁 master java threads
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<HTML>
<HEAD>
<META name=vsisbn content="1562438425"><META name=vstitle content="Mastering Java Threads"><META name=vsauthor content="Marc Adler and David Herst"><META name=vspublisher content="DDC Publishing, Inc."><META name=vspubdate content="05/01/99"><META name=vscategory content="Web and Software Development: Programming, Scripting, and Markup Languages: Java"><TITLE>Mastering Java Threads:Synchronization</TITLE>
<!-- HEADER --><STYLE type="text/css">  <!-- A:hover  { 	color : Red; } --></STYLE><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"><script><!--function displayWindow(url, width, height) {         var Win = window.open(url,"displayWindow",'width=' + width +',height=' + height + ',resizable=1,scrollbars=yes');	if (Win) {		Win.focus();	}}//--></script><SCRIPT><!--function popUp(url) {        var Win = window.open(url,"displayWindow",'width=400,height=300,resizable=1,scrollbars=yes');	if (Win) {		Win.focus();	}}//--></SCRIPT><script language="JavaScript1.2"><!--function checkForQuery(fm) {  /* get the query value */  var i = escape(fm.query.value);  if (i == "") {      alert('Please enter a search word or phrase');      return false;  }                  /* query is blank, dont run the .jsp file */  else return true;  /* execute the .jsp file */}//--></script><SCRIPT LANGUAGE="JavaScript"><!--var axel = Math.random() + "";var ord = axel * 1000000000000000000 + "?";//This part of script alleviates a Netscape document.write bug<!-- NS4 = document.layers;if (NS4) {origWidth = innerWidth;origHeight = innerHeight;}function reDo() {if (innerWidth != origWidth || innerHeight != origHeight) location.reload();}if (NS4) onresize = reDo;//--></SCRIPT></HEAD><body background="/images/back.jpg" bgcolor="#FFFFFF" link="#003399" alink="#FF0000" vlink="#003399" topmargin=0 leftmargin=0 marginheight=0 marginwidth=0><table bgcolor="#003366" width="100%" border="0" cellpadding="0" cellspacing="0">	<tr>		<td colspan="3">				<table width="100%">			<tr valign="top">				<td bgcolor="#003366">&nbsp;&nbsp;<a href="http://www.earthweb.com" target="resource window"><img src="/images/ew_logo.jpg" width="82" height="58"  alt="EarthWeb" border="0"></a>&nbsp;&nbsp;&nbsp;</td>				<td bgcolor="#003366" nowrap><SCRIPT LANGUAGE="JavaScript"><!--document.write('<NOLAYER>');document.write('<IFRAME SRC="http://ad.doubleclick.net/adi/academic.itknowledge.com/other;cat=enterprise;ord=' + ord + '" width="468" height="60" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no">');document.write('<A HREF="http://ad.doubleclick.net/jump/academic.itknowledge.com/other;cat=enterprise;ord=' + ord + '" target="_top"><IMG SRC="http://ad.doubleclick.net/ad/academic.itknowledge.com/other;cat=enterprise;ord=' + ord + '" width="468" height="60" border="0"></A>');document.write('</IFRAME>');document.write('</NOLAYER>');document.write('<ilayer id="ph1" visibility="hide" width="468" height="60"></ilayer>');//--></SCRIPT> <!-- <noscript><A HREF="http://ad.doubleclick.net/jump/academic.itknowledge.com/other;cat=enterprise;sz=468x60;num=123456?"><IMG SRC="http://ad.doubleclick.net/ad/academic.itknowledge.com/other;cat=enterprise;sz=468x60;num=123456? width="468" height="60" border="0"></A></noscript> -->				</td>				<td bgcolor="#003366" nowrap><SCRIPT LANGUAGE="javascript"><!--document.write('<NOLAYER>');document.write('<IFRAME SRC="http://ad.doubleclick.net/adi/itkaca.earthweb.dart/b_aca_soft_dev;a=b_aca_soft_dev4;sz=160x60;ord=' + ord + '" width="160" height="60" frameborder="no" border="0" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="no">');document.write('<A HREF="http://ad.doubleclick.net/jump/itkaca.earthweb.dart/b_aca_soft_dev;abr=!ie;a=b_aca_soft_dev4;sz=160x60;ord=' + ord + '" target="_top"><IMG SRC="http://ad.doubleclick.net/ad/itkaca.earthweb.dart/b_aca_soft_dev;abr=!ie;a=b_aca_soft_dev4;sz=160x60;ord=' + ord + '" border=0 height="60" width="160"></A>');document.write('</IFRAME>');document.write('</NOLAYER>');document.write('<ILAYER id="layer1" visibility="hidden" width=160 height=60></ILAYER>');//--></SCRIPT></td><td><a href="AITK1a2b3c4d5e6f7g8h9idefcon4.html"><img src="/images/dotblue.gif" border="0" height="1" width="1" align="right"></a></td>			</tr>		</table>				</td>	</tr>		<tr>		<td height="1" colspan="3" bgcolor="#003366"><img src="/images/dotclear.gif" border=0 alt=""></td>	</tr>	</table><!-- END HEADER --><!-- BEGIN SUB HEADER --><table bgcolor="#003366" cellpadding="0" cellspacing="0" border="0" width="100%"><!-- ITK TOPNAV -->		<tr>		<td align="left" valign="top" nowrap><a href="/"><img src="/images/top_tabs/home_off.gif" alt="Home" border="0"></a><!-- <a href="/content/corp.html"><img src="/images/top_tabs/subscribe.gif" alt="Subscribe" border="0"></a> --><a href="/search/"><img src="/images/top_tabs/search.gif" alt="Search" border="0"></a><a href="/faq/faq.html"><img src="/images/top_tabs/faq.gif" alt="FAQ" border="0"></a><a href="/sitemap.html"><img src="/images/top_tabs/sitemap.gif" alt="Sitemap" border="0"></a><a href="/contactus.html"><img src="/images/top_tabs/contact_us.gif" alt="Contact Us" border="0"></a></td> 	</tr>	<!-- END of ITK TOPNAV --><!-- ITK LOGO and newsletter sign up --></table>	<table cellpadding="0" cellspacing="0" border="0" width="100%">	<tr>		<td align="left" valign="top" nowrap><img src="/images/itk_logo_sm.jpg" alt="" border="0"></td>		<td align="right"><font face="verdana, sans-serif" size="1"><script language="JavaScript"><!-- var days = new Array(8);days[1] = "Sunday";days[2] = "Monday";days[3] = "Tuesday";days[4] = "Wednesday";days[5] = "Thursday";days[6] = "Friday";days[7] = "Saturday";var months = new Array(13);months[1] = "January";months[2] = "February";months[3] = "March";months[4] = "April";months[5] = "May";months[6] = "June";months[7] = "July";months[8] = "August";months[9] = "September";months[10] = "October";months[11] = "November";months[12] = "December";var dateObj = new Date()var wday = days[dateObj.getDay() + 1]var lmonth = months[dateObj.getMonth() + 1]var date = dateObj.getDate()var fyear = dateObj.getYear()if (fyear <1000) fyear += 1900;document.write(wday + ", " + lmonth + " " + date + ", " + fyear)                //--></script>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><br><br><!-- <img src="/images/enterprise_logo.gif" width="254" height="51" border="0"> --></td>	</tr></table><!-- END ITK LOGO and newsletter sign up-->	<!-- begin of ITK left NAV --><!-- BEGIN LEFT NAVBAR --><!-- BEGIN LEFT NAVBAR -->	<table border="0" cellpadding="0" cellspacing="0">				<tr>		<td width="145" valign="top" align="left" rowspan=8>			<!-- KEYWORD SEARCH -->	<script language="JavaScript1.2"><!--function checkForQuery(fm) {  /* get the query value */  var i = escape(fm.query.value);  if (i == "") {      alert('Please enter a search word or phrase');      return false;  }                  /* query is blank, dont run the .jsp file */  else return true;  /* execute the .jsp file */}//--></script>	<form name="keyword" method="POST" action="http://ewsearch.earthweb.com:80/jsp/k2search/ewkwk2search_p2.jsp" onSubmit=" return checkForQuery(this); "><img src="/images/keyword_searcha.gif" vspace="5" width="145" alt="" border="0"><INPUT type="hidden" name="collection" value="corpitk_p2"><INPUT type="hidden" name="altcoll" value="allbooks_p2"><INPUT type="hidden" name="hl" value="on"><INPUT name="sortspec" type=hidden value="vspubdate desc score desc"><INPUT name=fields type=hidden value="vdkvgwkey score vstitle vsauthor vsisbn vspublisher vspubdate">		<INPUT name=imageprefix type=hidden value="http://academic.itknowledge.com"><INPUT name=ssiFolder type=hidden value="itkaca"><INPUT name="topics" type="hidden" value="itk_academic">				<table width="145" border="0" cellpadding="0" cellspacing="0">		<tr>		<td width="145">&nbsp;&nbsp;<input type="text" name="query" value="" size="11">&nbsp;<input type="image" width=28 height=23 border=0 value="Go" name="Go" src="/images/go.gif" align=absmiddle><br>&nbsp;&nbsp;<INPUT type="radio" name="scope" value="" checked><font face="arial, helvetica" size="1" color="#FFFFFF">All ITKnowledge</FONT><br>&nbsp;&nbsp;<INPUT type="radio" name="scope" value="sourcecode"><font face="arial, helvetica" size="1" color="#FFFFFF">Source Code</FONT><br>			<font face="arial, helvetica" size="2">			<img src="/images/dotclear.gif" width="1" height="5" alt="" border="0"><br>						&nbsp;&nbsp;<a href="/search/search-tips.html"><img src="/images/arrows_blue.gif" alt="" border="0"><font size="1" color="#ffffff">Search Tips</font></a><br>			&nbsp;&nbsp;<a href="/search/"><img src="/images/arrows_blue.gif" alt="" border="0"><font size="1" color="#ffffff">Advanced Search</font></a><br>						</font>					</td>		<td width="5"><img src="/images/dotclear.gif" width=5 height=10 hspace="5" alt="" border="0"></td>		</tr>		</table>	</form>				<!-- BROWSE BY TOPIC -->		<form name="meta" method="POST" action="http://ewsearch.earthweb.com:80/jsp/k2search/ewmetak2search_p2.jsp" onSubmit=" return checkForQuery(this); "><img src="/images/publication_searcha.gif" width="145" alt="" border="0"><INPUT type="hidden" name="collection" value="allbooks_p2"><INPUT type="hidden" name="altcoll" value="corpitk_p2"><INPUT type="hidden" name="hl" value="on"><INPUT name="sortspec" type=hidden value="vspubdate desc score desc"><INPUT name=fields type=hidden value="vdkvgwkey score vstitle vsauthor vspublisher vspubdate"><INPUT name=imageprefix type=hidden value="http://academic.itknowledge.com"><INPUT name=ssiFolder type=hidden value="itkaca"><INPUT name="topics" type="hidden" value="itk_academic">		<table width="145" border="0" cellpadding="0" cellspacing="0">				<tr>			<td valign="top">			&nbsp;&nbsp;<input type="text" name="query" value="" size="11">&nbsp;<input type="image" width=28 height=23 border=0 value="Go" name="Go" src="/images/go.gif" align=absmiddle><br><font face="arial, helvetica" size="2">			&nbsp;&nbsp;<SELECT NAME="metatags" style="font-size: 12; font-family: sans-serif;" size="1">			<option value="vstitle" SELECTED>Title			<option value="vsauthor">Author			<option value="vspublisher">Publisher			<option value="vsisbn">ISBN						</SELECT><br><br></font>			</td>			</tr></table></form><form action="" name="catlist">	<table width="145" border="0" cellpadding="0" cellspacing="0">							<tr>			<td valign="top">			<img src="/images/jump_topica.gif" width="145" alt="" border="0">			</td>			</tr>			<tr>			<td width="145">					        	<font face="Arial,helvetica" size="1">				&nbsp;&nbsp;<SELECT NAME="cat" onChange='top.location.href=this.options[selectedIndex].value;' style="font-size: 10; font-family: sans-serif;">                        <option value="" selected>Please Select                        <option value="">-----------						<option value="/reference/dir.1-busman.html">Business &amp; IT Mgmt						<option value="/reference/dir.2-certification.html">Certification &amp; Training                       						<option value="/reference/dir.3-databaseanderp.html">Database &amp; ERP                        <option value="/reference/dir.4-desktopapps.html">Desktop Apps                        <option value="/reference/dir.5-desktoppubanddesign.html">Graphic Design                        <option value="/reference/dir.6-generalinternet.html">General Internet                        <option value="/reference/dir.7-hardwareandos.html">Hardware &amp; OS                        <option value="/reference/dir.8-ibmredbooks.html">IBM RedBooks                        <option value="/reference/dir.9-networktelcom.html">Network &amp; Telecom						<option value="/reference/dir.10-websoftwaredev.html">Web &amp; Software Dev						<option value="/reference/dir.11-careers.html">Careers                        <option value="">-----------                        <option value="/reference/whatsnew.html">New Arrivals                        </SELECT>						</font>			</td>			</tr></table></form>	<!-- LEFT NAV SEARCH END --><table border="0" cellspacing="0" cellpadding="0">	<tr>		<td><a href="/desktop/"><img src="/images/desktop_icona.gif" border=0 alt="Go to ITKnowledge Academic"></a><br><br></td>	</tr></table>		<!-- BEGIN TEXT LINKS --><!-- END TEXT LINKS --><!-- END LEFT NAVBAR --><!-- END LEFT NAVBAR -->		<td width="15"><img src="/images/dotclear.gif" width="15" alt="" border="0"></td><!-- end of ITK left NAV --><!-- begin main content -->		<td width="100%" valign="top" align="left">		<br><!-- END SUB HEADER --><!-- Created by dB Page Builder.  http://www.pchelponline.com/bluestem -->

<!--Begin Content Column -->

<TABLE border=0 cellspacing=0 cellpadding=0>
<tr>
<td width=75 valign=top>
<img src="/images/sm_covers/1562438425.gif" width=60 height=73 alt="Mastering Java Threads" border="1">
</td>
<td align="left">
    <font face="arial, helvetica" size="-1" color="#336633"><b>Mastering Java Threads</b></font>
    <br>
    <font face="arial, helvetica" size="-1"><i>by Marc Adler and David Herst</i>
    <br>
    DDC Publishing, Inc.
    <br>
    <b>ISBN:</b>&nbsp;1562438425<b>&nbsp;&nbsp;&nbsp;Pub Date:</b>&nbsp;05/01/99</font>&nbsp;&nbsp;<A HREF="http://www.digitalguru.com/dgstore/product.asp?isbn=1562438425&ac%5Fid=28" TARGET="anotherwindows"><img src="/images/buyit.gif" width=64 height=23 hspace="5" align="middle" alt="Buy It" border="0"></a>
</td>
</tr>
</table>
<P>
<form name="advanced" method="POST" action="http://ewsearch.earthweb.com:80/jsp/k2search/ewintrak2search_p2.jsp" onSubmit=" return checkForQuery(this); ">
<INPUT type="hidden" name="collection" value="corpitk_p2">
<INPUT type="hidden" name="altcoll" value="allbooks_p2">
<INPUT type="hidden" name="hl" value="on">
<INPUT name="sortspec" type=hidden value="score desc">
<INPUT name="fields" type=hidden value="vdkvgwkey score vstitle vsisbn vsauthor vspublisher vspubdate">
<INPUT name="imageprefix" type=hidden value="http://academic.itknowledge.com">
<INPUT name="ssiFolder" type=hidden value="itkaca">
<INPUT name="topics" type=hidden value="itk_academic">
<INPUT type="hidden" name="bookid" value="t_1562438425">

<font face="arial, helvetica" size=2><b>Search this book:</b></font><br>
<INPUT NAME="query" size=25 VALUE="">&nbsp;<input type="image" width=28 height=23 border=0 value="Go" name="Go" src="/images/go.gif" align=absmiddle>

</form>


<!-- Empty Reference Subhead -->

<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="09-03.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="../ewtoc.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P>The <SMALL>PingPong</SMALL> object uses the variable <SMALL>whoseTurn</SMALL> as a gate to the section of code that simulates hitting the ball. If, for some reason, the wrong thread gets into the hit function, it is forced to wait until the other thread wakes it up.</P>
<P><SMALL><B>GAME.JAVA</B></SMALL></P>

<TABLE BORDER="2" BORDERCOLOR="#0000" WIDTH="90%" ALIGN="CENTER">
<TR><TD>
<!-- CODE //-->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -