SWT Thread Problem while using asyncExec
Hello,
I have a really simple Problem - but I just can't fix it:
From a main method 2 Threads are started - one initializes a Database connection, another one should update a Progress Bar (variable in main class) in between. Since I do not know exactly how long the db connection takes, the Progress Bar Thread should wait for the DB thread to join, before further processes are made.
DBThread.start();
ProgressBarThread.start();
DBThread.join(); // no further steps before this thread has joined!!
And thats the Problem - whenever I include a DBThread.join() in the main method or the ProgressBarThread-run() method (I have to wait for the connection to be created!), the other Thread shows no update of the ProgressBar, although It is still alive (checked it with output messages, they are OK ) - after the DBThread has joined, a filled ProgressBar is shown.
BTW, there are no exceptions thrown.
Anyody an idea? Or another way to solve this problem? I used display.asyncExec() to update the ProgressBar - and it works fine without join(), the problem is, that the programm continues - and it must not...
THX for all answers
tubeking
PS: I tried to include a "wait()" in the main method and put an notifyAll() in the run() method of the DBThread right after the initProcess - this caused the Error "thread not owner)...

