I have a program that runs in a few threads. The main thread shares an object with the other threads and in the main I have a call to:
synchronized(obj){
you can use the setPriority() method. For example:
new MyThread("Foo").start();
Thread bar = new MyThread("Bar");
bar.setPriority( Thread.NORM_PRIORITY + 1 );
bar.start();
This gives bar the new priority which should quickly take over Foo
Edit:
To answer your comment, you can set the max priortiy using:
bar.setPriority( Thread.MAX_PRIORITY );