Thread: how to read current semaphore value

  1. #16
    Registered User
    Join Date
    May 2010
    Posts
    26
    Quote Originally Posted by brewbuck View Post
    If you find yourself wanting to obtain the value of a semaphore, you should be thinking "I'm about to create a bug."

    There is no such thing as "the value of a semaphore." By the time you've read the value, the value may have changed. It is inherently wrong. Semaphores are waited upon, and signaled. That's it.
    yes but I need the sem value for debugging my software

    @tabstop: I know what an int* is...the strange -for me- is that I'm so lucky to get no error using arg.array without any allocation
    Last edited by np2k; 05-25-2010 at 02:27 AM.

  2. #17
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by np2k View Post
    @tabstop: I know what an int* is...the strange -for me- is that I'm so lucky to get no error using arg.array without any allocation
    I don't know what (if anything) I've been doing recently, but I've been getting large values in my uninitialized values recently. You must be doing the same thing. But it's still pretty random.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  2. compiler build error
    By KristTlove in forum C++ Programming
    Replies: 2
    Last Post: 11-30-2003, 10:16 AM
  3. HelpMePlease
    By Prncess100 in forum C++ Programming
    Replies: 6
    Last Post: 12-11-2002, 02:02 PM
  4. Read Array pro!!Plz help!!
    By Supra in forum C Programming
    Replies: 2
    Last Post: 03-04-2002, 03:49 PM
  5. Help! Can't read decimal number
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 09-07-2001, 02:09 AM