Revision 1182,
505 bytes
checked in by niltonneto, 15 years ago
(diff) |
Ticket #558 - Criado pasta security a partir da pasta seguranca.
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[1182] | 1 | |
---|
| 2 | public class DataReader { |
---|
| 3 | |
---|
| 4 | private boolean flag = false; |
---|
| 5 | private String resultado; |
---|
| 6 | |
---|
| 7 | public synchronized String getResultado(){ |
---|
| 8 | lock(); |
---|
| 9 | //notifyAll(); |
---|
| 10 | return this.resultado; |
---|
| 11 | } |
---|
| 12 | |
---|
| 13 | public synchronized void setResultado(String resultado){ |
---|
| 14 | //flag = true; |
---|
| 15 | this.resultado = resultado; |
---|
| 16 | } |
---|
| 17 | |
---|
| 18 | public synchronized void unlock(){ |
---|
| 19 | flag = true; |
---|
| 20 | notifyAll(); |
---|
| 21 | } |
---|
| 22 | |
---|
| 23 | private synchronized void lock(){ |
---|
| 24 | while (!flag){ |
---|
| 25 | try{ |
---|
| 26 | wait(); |
---|
| 27 | } |
---|
| 28 | catch (InterruptedException e){} |
---|
| 29 | } |
---|
| 30 | flag = false; |
---|
| 31 | } |
---|
| 32 | |
---|
| 33 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.