Variable looses it's value
Variable looses it's value
- Subject: Variable looses it's value
- From: "Peter Karlsson" <email@hidden>
- Date: Thu, 16 Dec 2004 13:07:55 +0100
Dear list!
My variable is declared like this in my controller.h file:
int sysexcounter;
When I click on a button a new thread is started and I reset the variable:
sysexcounter = 0;
Then in my MyReadProc code it's increased every time I receive a midi byte:
sysexcounter+=1;
And in the new thread I use this code to stop the flow until all bytes have
been received.
while(sysexcounter < dumpSize)
{
usleep(1000000); // microseconds
}
This works sometimes and sometimes not. I have not seen any pattern at all.
The problem is that my variable sysexcounter is sometimes 0 in my while
loop and it will continue looping forever. The variable sysexcounter seems
to loose it's value, can someone please tell me why?
Best regards Peter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden