• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Threading guidance to avoid potential deadlock...

 
Mattias Sands�ter
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get the warning "Warning: To avoid potential deadlock, operations that may block, such as networking, should be performed in a different thread than the commandAction() handler."

It starts when I start to access the file system, more specific when I try to list the roots with listRoot(). I know this would be fixed with threading but I am not so good at it. I did do some tries but without success.

Should I move all my filesystem methods into some threaded class or just parts of it? Please guide me into the right direction.
 
pradeep u nair
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friend
call your function inside this block of code in the listener
new Thread(new Runnable(){
public void run()
{
try{
//your function call
}catch(Exception e){}
}
}).start();

hope this helps
Pradeep
 
Mattias Sands�ter
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for trying help me.

Do you mean that when I arrive to a filesystem sensetive method call like listRoots() I just do like this:



I tried this, but it couldn�t reach the e-variable from inside the inner class.
[ May 05, 2006: Message edited by: Mattias Sands�ter ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic