|
-
thread problem....pls help
Hi I am still having problems with this bit of code....
the wait method is hanging the system..if if say
syncObj.wait(2000)
then it works..but there doesnrt seem to be any communication between
noify() and wait() methods. I am not able to work out about the problem...pls
do help...
Regards
Satish
private boolean upgradeComplete= false;
private Object syncObj = new Object();
if (response == JOptionPane.YES_OPTION)
{
depotVersion = JOptionPane.showInputDialog(parent,
"Please enter the depotVersion:" /*13A*/);
txtDisplay.append("Performing the OAM Upgrade " +
'\n');
// get ats connection, prepare data and send it
txtOAMVersion.setText(" ");
// pls check the code from here...................................
callInvokeOAMUpgrade();
// this mathod takes a few secs to execute and I want the callCurrentVersion
to wait for this to complete...
synchronized(syncObj)
{
while(upgradeComplete = false);
{
System.out.println(upgradeComplete);
try
{
syncObj.wait(); // I waant this to wait..
}
catch (Exception e){ }
}
if(upgradeComplete = true)
{
System.out.println(upgradeComplete);
syncObj.notify(); //after completion it notifys
callCurrentVersion();
}
}
}
else if (response == JOptionPane.NO_OPTION)
{
txtDisplay.append(" OAM Upgrade cancelled" + '\n');
}
btnOAMRollback.setEnabled(true);
btnOAMUpgrade.setEnabled(true);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks