Menu

#13 Thrading Process Problem

open
nobody
None
5
2006-10-18
2006-10-18
Anonymous
No

I am evaluating NUnitForm for an easy .Net application.
It is a common use, if you press a button to start the
assoziated task in an extra Thread, so the gui thread
is able to refresh the controls.
To synchronize the running Thread with the UnitTest I
have a cancel butten which is only enabled when the
worker thread is running.
The Testcase runs perfect until the start button
is pressed an the main work should start. Nearl
nothing happened.

I can reproduce this problem in a very easy testcase.

private void start() {
form1 = new Form1();
form1.Show();
}

public TestCaseXXX(){

// start Thread
Thread t = new Thread(new ThreadStart(this.start));
t.Start();

// synchronize thread.
while (t.IsAlive)
Thread.Sleep(10);

form1.textBox1.Text = "3";
form1.textBox2.Text = "7";
form1.buttonAddiere.
}

If you start the testcase without threading it runs
perfect.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.