-
June 22nd, 2004, 03:26 PM
#1
CreateSemaphore WIN32 Interface
What is the maximum value that a semaphore can have? The CreateSemaphore takes in two LONGs for the inital and maximal value but passing in std::numeric_limits<LONG>::max() causes CreateSemaphore to fail (returning NULL).
Is there a documented max or #define magic constant defining the maximal count?
The views expressed are those of the author and do not reflect any position taken by the Goverment of the United States of America, National Aeronautics and Space Administration (NASA), Jet Propulsion Laboratory (JPL), or California Institute of Technology (CalTech)
-
June 22nd, 2004, 04:14 PM
#2
What is the error?
What is the exact numeric value that std::numeric_limits<LONG>::max() returns?
Kuphryn
-
June 22nd, 2004, 04:19 PM
#3
std::numeric_limits<LONG>::max() returns an implementation defined value of type LONG that represents the largest possible positive value for the LONG datatype (ie. biggest integral value long can hold).
The views expressed are those of the author and do not reflect any position taken by the Goverment of the United States of America, National Aeronautics and Space Administration (NASA), Jet Propulsion Laboratory (JPL), or California Institute of Technology (CalTech)
-
June 22nd, 2004, 06:49 PM
#4
Correct.
Run the application in debug mode. What is the exact numeric value that std::numeric_limits<LONG>::max() returns?
Kuphryn
-
June 23rd, 2004, 03:18 AM
#5
Re: CreateSemaphore WIN32 Interface
Originally posted by mclark
What is the maximum value that a semaphore can have? The CreateSemaphore takes in two LONGs for the inital and maximal value but passing in std::numeric_limits<LONG>::max() causes CreateSemaphore to fail (returning NULL).
As usual...what does 'GetLastError()' return?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|