RE: Variable looses it's value
RE: Variable looses it's value
- Subject: RE: Variable looses it's value
- From: "Peter Karlsson" <email@hidden>
- Date: Fri, 17 Dec 2004 13:17:22 +0100
After some experimenting I know that my problem is not that the
sysexcounter variable is reset to 0. When that happens it's because it was
never set to another value. So my guess is that the sysex dump message is
transmitted to fast to my synthesizer. And it will not respond at all. Just
wanted to share it with you all...
Peter
Ursprungligt meddelande
> 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
>
_______________________________________________
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