| Author |
synchronisation error
|
arjun rampal
Ranch Hand
Joined: Jul 08, 2005
Posts: 125
|
|
Hi I have a file which if exists should print "got it" else it should print "not got it".Gettin boolean value through for this through res.getres().Now follwoing are two files.Issue is when file is there i get the correct message but when file is not there I am not getting any messgae. [HENRY: Added code tags] [ October 29, 2006: Message edited by: Henry Wong ]
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16811
|
|
There is nothing in the example that you've shown that prints either "got it" or "not got it". Henry
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
arjun rampal
Ranch Hand
Joined: Jul 08, 2005
Posts: 125
|
|
Hi this is third file to get it if (res.getres()){ System.out.println("got it") else{ System.out.println(" not got it") } where res.getres returning boolean value
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16811
|
|
The "not got it" message will never print. The reason is because the getres() method will always return true -- while the avai variable is false it will wait. Henry
|
 |
arjun rampal
Ranch Hand
Joined: Jul 08, 2005
Posts: 125
|
|
Hi how to rectify this regards
|
 |
 |
|
|
subject: synchronisation error
|
|
|