+ Reply to Thread
Results 1 to 2 of 2

Thread: How to increment an integer without using a Critical Section or Mutex?

  1. #1

    How to increment an integer without using a Critical Section or Mutex?

    How to increment an integer without using a Critical Section or Mutex?

    Is there any fast or easy way to do this?

    Please help.

  2. #2
    Senior Member
    Join Date
    Feb 2012
    Posts
    109
    Yes, you can use InterlockedIncrement and InterlockedDecrement function.

    It accepts LONG as an argument but I think that should be an issue for you.

    Above procedures are for 32bit programming.

    For LONGLONG data-type, use InterlockedIncrement64 and its counterparts.

    Hope this helps.

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts