• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Variable looses it's value
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Variable looses it's value
      • From: Nicko van Someren <email@hidden>
    • Re: Variable looses it's value
      • From: Jiri Volejnik <email@hidden>
  • Prev by Date: Re: Stacking run loops
  • Next by Date: setLineDash for grid lines
  • Previous by thread: Re: Wrapping an Interactive Unix Executable
  • Next by thread: Re: Variable looses it's value
  • Index(es):
    • Date
    • Thread