|
Message
From: cvs at opencores.org<cvs@o...>
Date: Mon Oct 30 18:50:35 CET 2006
Subject: [cvs-checkins] MODIFIED: jop ...
Date: 00/06/10 30:18:50 Modified: jop/java/target/src/common/util DbgUdp.java Log: synchronize the read and write to the message buffer Revision Changes Path 1.2 jop/java/target/src/common/util/DbgUdp.java http://www.opencores.org/cvsweb.shtml/jop/java/target/src/common/util/DbgUdp.java.diff?r1=1.1&r2=1.2 (In the diff below, changes in quantity of whitespace are not shown.) Index: DbgUdp.java =================================================================== RCS file: /cvsroot/martin/jop/java/target/src/common/util/DbgUdp.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -b -r1.1 -r1.2 --- DbgUdp.java 11 May 2005 16:31:15 -0000 1.1 +++ DbgUdp.java 30 Oct 2006 17:50:35 -0000 1.2 @@ -19,12 +19,14 @@ void dbgWr(int c) { + synchronized(txBuf) { if (((wrptTx+1)&BUF_MSK) == rdptTx) { return; // buffer full => drop value } txBuf[wrptTx] = c; wrptTx = (wrptTx+1)&BUF_MSK; } + } /** * read out buffer and write it in udp packet. @@ -33,6 +35,7 @@ int i, j, k; + synchronized(txBuf) { j = 0; k = pos; for (i=0; rdptTx!=wrptTx; ++i) { @@ -51,6 +54,7 @@ } udpBuf[k] = j; } + } return i; }; }
|
 |