Showing posts with label Riddle. Show all posts
Showing posts with label Riddle. Show all posts

Thursday, 16 April 2009

Feature or Bug - named sync object mystery

If you think that a good old Win32 API call like CreateSemaphore() can't come to surprise us old war horses (I'm celebrating my last 3x birthday today :-)
you're just plain wrong.

The mystery
What's the difference in behavior, when you create multiple times a semaphore on Windows CE and on Windows XP with the following 2 different code snippets?

handle = CreateSemaphore( NULL, initialCount, maxCount, NULL);

and
handle = CreateSemaphore( NULL, initialCount, maxCount, _T("") );


Dear readers - enlighten us.
I will unravel the mystery later this week ;-)
Read more! Post this to a friend!