G
Grant
Problem:
I would like to save a file (Using C#) but am getting the occassional write
error. I would like to do that on another thread but how would I know
whether it was a success or failure?
--------------------------
Thread WorkerThread = new Thread(new ThreadStart(updateSomething));
WorkerThread.Start();
Thread WatcherThread = new Thread(new ThreadStart(ThreadWatcher));
WatcherThread.Start();
private void ThreadWatcher(){
while ( some boolean value is false on the first thread)
{
Thread.sleep(100);
}
when it gets out the loop do something here;
}
--------------------------
Do I have to have another watcher thread that sleeps while the worker thread
is still busy - and when it is finished, check its status? How would I do
this?
Thanks,
Grant
I would like to save a file (Using C#) but am getting the occassional write
error. I would like to do that on another thread but how would I know
whether it was a success or failure?
--------------------------
Thread WorkerThread = new Thread(new ThreadStart(updateSomething));
WorkerThread.Start();
Thread WatcherThread = new Thread(new ThreadStart(ThreadWatcher));
WatcherThread.Start();
private void ThreadWatcher(){
while ( some boolean value is false on the first thread)
{
Thread.sleep(100);
}
when it gets out the loop do something here;
}
--------------------------
Do I have to have another watcher thread that sleeps while the worker thread
is still busy - and when it is finished, check its status? How would I do
this?
Thanks,
Grant