C language function:CreateSemaphore sample codes

Search sample code in the internet.It is the result.


TITLE : Locking mechanisms | Adi Levin's Blog for programmers
HANDLE s = CreateSemaphore(NULL,2,2,hadih);.......
http://adilevin.wordpress.com/2009/06/04/locking-mechanisms/


TITLE : Locking mechanisms | Adi Levin's Blog for programmers
The call to CreateSemaphore(NULL,2,2,hadih) creates a named semaphore object, with a current counter value 2, and the maximum counter value2. Think of the counter as representing the number of available resources. When a semaphore satisfies a wait (i.e. after WaitForSingleObject(s,INFINITE) returns), its count is decreased by 1. When its count is zero, WaitForSingleObject(s,INFINITE) will block the thread until another thread release the semaphore, thereby increasing its count........
http://adilevin.wordpress.com/2009/06/04/locking-mechanisms/
TITLE : Locking mechanisms | Adi Levin's Blog for programmers
But then I saw that you are a Semaphore ? after reading HANDLE s = CreateSemaphore(NULL,2,2,hadih);.......
http://adilevin.wordpress.com/2009/06/04/locking-mechanisms/
TITLE : Sharing Kernel Objects Across Process Boundaries - 51CTO.COM
HANDLE CreateSemaphore(.......
http://book.51cto.com/art/200808/87778.htm
TITLE : Sharing Kernel Objects Across Process Boundaries - 51CTO.COM
HANDLE hSem = CreateSemaphore(NULL, 1, 1, TEXT("JeffObj"));.......
http://book.51cto.com/art/200808/87778.htm
TITLE : c++ - "Fast" Read/Write Lock - Code Review Stack Exchange
m_hReadSem = CreateSemaphore(0,0,0x10000,0); // create ananymous semaphores with maximum value much larger.......
http://codereview.stackexchange.com/questions/6483/fast-read-write-lock
TITLE : c++ - "Fast" Read/Write Lock - Code Review Stack Exchange
m_hWriteSem = CreateSemaphore(0,0,0x10000,0); // than any possible value of waiting count fields.......
http://codereview.stackexchange.com/questions/6483/fast-read-write-lock
TITLE : c++ - "Fast" Read/Write Lock - Code Review Stack Exchange
m_hReadSem = CreateSemaphore(0,0,0x10000,0);.......
http://codereview.stackexchange.com/questions/6483/fast-read-write-lock
TITLE : Win32 Multithreading and Synchronization
HANDLE CreateSemaphore(.......
http://faq.programmerworld.net/programming/win32-multithreading-and-synchronization.html
TITLE : Prevent Multiple Instance of a Program (using Mutex) - Pascal and Delphi Tutorials - Codecall
Sem := CreateSemaphore(nil, 0, 1, 'PROGRAM_RMC');.......
http://forum.codecall.net/topic/61751-prevent-multiple-instance-of-a-program-using-mutex/
TITLE : Using one onComplete with multiple functions - Lua Language - Corona Labs Forums
function createSemaphore(count, onComplete).......
http://forums.coronalabs.com/topic/62229-using-one-oncomplete-with-multiple-functions/
TITLE : Using one onComplete with multiple functions - Lua Language - Corona Labs Forums
local semaphore = createSemaphore(3, finalOnComplete).......
http://forums.coronalabs.com/topic/62229-using-one-oncomplete-with-multiple-functions/
TITLE : Using one onComplete with multiple functions - Lua Language - Corona Labs Forums
Hi Ronburk. Thanks for the explanation, yea the table listener timer part fed to timer.performWithDelay() threw me a bit as I was never planning to work with timers. But your new code with use of createSemaphore() is pretty elegant. I think this is a nice solution........
http://forums.coronalabs.com/topic/62229-using-one-oncomplete-with-multiple-functions/
TITLE : Using one onComplete with multiple functions - Lua Language - Corona Labs Forums
function createSemaphore(count, onComplete).......
http://forums.coronalabs.com/topic/62229-using-one-oncomplete-with-multiple-functions/
TITLE : Using one onComplete with multiple functions - Lua Language - Corona Labs Forums
local semaphore = createSemaphore(3, finalOnComplete).......
http://forums.coronalabs.com/topic/62229-using-one-oncomplete-with-multiple-functions/
TITLE : SDL2: src/audio/xaudio2/SDL_xaudio2.c | Fossies
this->hidden->semaphore = SDL_CreateSemaphore(1);.......
http://fossies.org/linux/SDL2/src/audio/xaudio2/SDL_xaudio2.c
TITLE : SDL2: src/audio/xaudio2/SDL_xaudio2.c | Fossies
return SDL_SetError("XAudio2: CreateSemaphore() failed!");.......
http://fossies.org/linux/SDL2/src/audio/xaudio2/SDL_xaudio2.c
TITLE : Controlling The Number Of Application Instances - Visual FoxPro Wiki
lnhSemaphore = CreateSemaphore(0,lnInstancesAllowed,lnInstancesAllowed,lcUniqueSemaphore).......
http://fox.wikis.com/wc.dll@Wiki~ControllingTheNumberOfApplicationInstances
TITLE : Windows-driver-samples/mspyUser.c at master Microsoft/Windows-driver-samples GitHub
context.ShutDown = CreateSemaphore( NULL,.......
http://github.com/Microsoft/Windows-driver-samples/blob/master/filesys/miniFilter/minispy/user/mspyUser.c
TITLE : VK10 (LWJGL 3.1.3 SNAPSHOT)
static int vkCreateSemaphore(VkDevice device, VkSemaphoreCreateInfo pCreateInfo, VkAllocationCallbacks pAllocator, long[] pSemaphore).......
http://javadoc.lwjgl.org/org/lwjgl/vulkan/VK10.html
TITLE : VK10 (LWJGL 3.1.3 SNAPSHOT)
static int vkCreateSemaphore(VkDevice device, VkSemaphoreCreateInfo pCreateInfo, VkAllocationCallbacks pAllocator, java.nio.LongBuffer pSemaphore).......
http://javadoc.lwjgl.org/org/lwjgl/vulkan/VK10.html
TITLE : VK10 (LWJGL 3.1.3 SNAPSHOT)
public static int vkCreateSemaphore(VkDevice device,.......
http://javadoc.lwjgl.org/org/lwjgl/vulkan/VK10.html
TITLE : VK10 (LWJGL 3.1.3 SNAPSHOT)
VkResult vkCreateSemaphore(.......
http://javadoc.lwjgl.org/org/lwjgl/vulkan/VK10.html
TITLE : VK10 (LWJGL 3.1.3 SNAPSHOT)
public static int vkCreateSemaphore(VkDevice device,.......
http://javadoc.lwjgl.org/org/lwjgl/vulkan/VK10.html
TITLE : CreateSemaphore (Compact 2013)
HANDLE CreateSemaphore(.......
http://msdn.microsoft.com/en-us/library/ee488431.aspx
TITLE : CreateSemaphore (Compact 2013)
*pHandle = CreateSemaphore(pSemaphoreAttributes, InitialCount, MaximumCount, pName);.......
http://msdn.microsoft.com/en-us/library/ee488431.aspx
TITLE : CreateSemaphore function (Windows)
HANDLE WINAPI CreateSemaphore(.......
http://msdn.microsoft.com/ja-jp/library/windows/desktop/ms682438(v=vs.85).aspx
TITLE : Implementing a Recursive Mutex
m_semaphore = CreateSemaphore(NULL, 0, 1, NULL);.......
http://preshing.com/20120305/implementing-a-recursive-mutex
TITLE : Metered concurrency - Rosetta Code
#Threads=10#Parallels=3Global Semaphore=CreateSemaphore(#Parallels) Procedure Worker(*arg.i) WaitSemaphore(Semaphore) Debug "Thread #"+Str(*arg)+" active." Delay(Random(2000)) SignalSemaphore(Semaphore)EndProcedure ; Start a multi-thread based workDim thread(#Threads)For i=0 To #Threads thread(i)=CreateThread(@Worker(),i)Next Debug "Launcher done." ; Wait for all threads to finish before closing downFor i=0 To #Threads If IsThread(i) WaitThread(i) EndIfNext.......
http://rosettacode.org/wiki/Metered_concurrency
TITLE : centos - V8js PHP module on Linux - can't find libv8.so - Server Fault
shell.cc:(.text+0x10a3): undefined reference to `v8::internal::OS::CreateSemaphore(int)'.......
http://serverfault.com/questions/252346/v8js-php-module-on-linux-cant-find-libv8-so
TITLE : centos - V8js PHP module on Linux - can't find libv8.so - Server Fault
shell.cc:(.text+0x10b2): undefined reference to `v8::internal::OS::CreateSemaphore(int)'.......
http://serverfault.com/questions/252346/v8js-php-module-on-linux-cant-find-libv8-so
TITLE : Multi-core Programming Programming with Windows Threads. - ppt download
36 Programming with Windows Threads Win32* Semaphore Creation HANDLE CreateSemaphore( LPSECURITY_ATTRIBUTES lpEventAttributes, LONG lSemInitial, // Initial count value LONG lSemMax, // Maximum value for count LPCSTR lpSemName); // text name for object Value of lSemMax must be 1 or greater Value of lSemInitial must be greater than or equal to zero, less than or equal to lSemMax, and cannot go outside of range.......
http://slideplayer.com/slide/7689096/
TITLE : API without Secrets: Introduction to Vulkan* Part 5 | Intel Software
if( !CreateSemaphore( &Vulkan.RenderingResources[i].ImageAvailableSemaphore ) ) {.......
http://software.intel.com/en-us/articles/api-without-secrets-introduction-to-vulkan-part-5
TITLE : API without Secrets: Introduction to Vulkan* Part 5 | Intel Software
if( !CreateSemaphore( &Vulkan.RenderingResources[i].FinishedRenderingSemaphore ) ) {.......
http://software.intel.com/en-us/articles/api-without-secrets-introduction-to-vulkan-part-5
TITLE : API without Secrets: Introduction to Vulkan* Part 5 | Intel Software
bool Tutorial05::CreateSemaphore( VkSemaphore *semaphore ) {.......
http://software.intel.com/en-us/articles/api-without-secrets-introduction-to-vulkan-part-5
TITLE : API without Secrets: Introduction to Vulkan* Part 5 | Intel Software
if( vkCreateSemaphore( GetDevice(), &semaphore_create_info, nullptr, semaphore ) != VK_SUCCESS ) {.......
http://software.intel.com/en-us/articles/api-without-secrets-introduction-to-vulkan-part-5
TITLE : MinGW-w64 - for 32 and 64 bit Windows / Mailing Lists
+ handle = CreateSemaphore(NULL, (LONG) value, (LONG) SEM_VALUE_MAX,.......
http://sourceforge.net/p/mingw-w64/mailman/message/31658134/
TITLE : MinGW-w64 - for 32 and 64 bit Windows / Mailing Lists
+ HANDLE handle = CreateSemaphore(NULL, (LONG) value, (LONG).......
http://sourceforge.net/p/mingw-w64/mailman/message/31658134/
TITLE : MinGW-w64 - for 32 and 64 bit Windows / Mailing Lists
+ DBG( "sem_init() CreateSemaphore(), windows error %d\n",.......
http://sourceforge.net/p/mingw-w64/mailman/message/31658134/
TITLE : MinGW-w64 - for 32 and 64 bit Windows / Mailing Lists
+ handle = CreateSemaphore(NULL, (LONG) value, (LONG) SEM_VALUE_MAX,.......
http://sourceforge.net/p/mingw-w64/mailman/message/31658134/
TITLE : MinGW-w64 - for 32 and 64 bit Windows / Mailing Lists
+ HANDLE handle = CreateSemaphore(NULL, (LONG) value, (LONG).......
http://sourceforge.net/p/mingw-w64/mailman/message/31658134/
TITLE : MinGW-w64 - for 32 and 64 bit Windows / Mailing Lists
+ DBG( "sem_init() CreateSemaphore(), windows error %d\n",.......
http://sourceforge.net/p/mingw-w64/mailman/message/31658134/
TITLE : c++ - WaitForSingleObject on a semaphore does not wait, returns immediately - Stack Overflow
HANDLE createSemaphore = CreateSemaphore(NULL, 1, 1, "Semafor");.......
http://stackoverflow.com/questions/19548588/waitforsingleobject-on-a-semaphore-does-not-wait-returns-immediately
TITLE : Professor Mark Csele: USB Win-32 Logic Analyzer
hSyncDAQ = CreateSemaphore( NULL, 0, 1, NULL );.......
http://technology.niagarac.on.ca/staff/mcsele/LogicAnalyzer.html
TITLE : Converting Win32 Kernel-mode Print Drivers to User Mode
with the Win32 CreateSemaphore(), it's more efficient to replace.......
http://unixwiz.net/techtips/win32-pdriver-ktou.html
TITLE : Port Windows IPC apps to Linux, Part 2: Semap...
In Windows, CreateSemaphore() is used to create or open a named or unnamed semaphore........
http://www.360doc.com/content/10/0709/13/4910_37844727.shtml
TITLE : Port Windows IPC apps to Linux, Part 2: Semap...
HANDLE CreateSemaphore(.......
http://www.360doc.com/content/10/0709/13/4910_37844727.shtml
TITLE : Port Windows IPC apps to Linux, Part 2: Semap...
hSemaphore = CreateSemaphore(.......
http://www.360doc.com/content/10/0709/13/4910_37844727.shtml
TITLE : Using the Windows API in Delphi
if (CreateSemaphore(nil, 0, 1,.......
http://www.blong.com/Conferences/BorConUK97/WinAPI/Api.htm
TITLE : C++ Tutorial: Multi-Threaded Programming II - Thread for Win32 (B) - 2017
A semaphore can be created by calling CreateSemaphore(), which takes four parameters:.......
http://www.bogotobogo.com/cplusplus/multithreading_win32B.php
TITLE : C++ Tutorial: Multi-Threaded Programming II - Thread for Win32 (B) - 2017
HANDLE WINAPI CreateSemaphore(.......
http://www.bogotobogo.com/cplusplus/multithreading_win32B.php
TITLE : C++ Tutorial: Multi-Threaded Programming II - Thread for Win32 (B) - 2017
The following example demonstrates a semaphore being used as a replacement for a mutex. The semaphore is created to hold a maximum value of 1 and an initial value of 1, CreateSemaphore(0, 1, 1, 0). Two threads are created, and both threads execute the same code, which increments the variable count by 100. The end result of this is that the variable count contains 200 when the application ends........
http://www.bogotobogo.com/cplusplus/multithreading_win32B.php
TITLE : C++ Tutorial: Multi-Threaded Programming II - Thread for Win32 (B) - 2017
semaphore = CreateSemaphore(0, 1, 1, 0);.......
http://www.bogotobogo.com/cplusplus/multithreading_win32B.php
TITLE : List Control displaying image thumbnails
imageFillerSemaphore=CreateSemaphore(NULL, 0,1, NULL);.......
http://www.codeguru.com/cpp/controls/listview/usingimages/article.php/c899/List-Control-displaying-image-thumbnails.htm
TITLE : List Control displaying image thumbnails
imageFillerCR=CreateSemaphore(NULL, 1,1, NULL);.......
http://www.codeguru.com/cpp/controls/listview/usingimages/article.php/c899/List-Control-displaying-image-thumbnails.htm
TITLE : List Control displaying image thumbnails
imageFillerWait=CreateSemaphore(NULL, 1,1, NULL);.......
http://www.codeguru.com/cpp/controls/listview/usingimages/article.php/c899/List-Control-displaying-image-thumbnails.htm
TITLE : process.h - Digital Mars
full = CreateSemaphore(NULL, 0, 2, "_beginth_sema1");.......
http://www.digitalmars.com/rtl/process.html
TITLE : process.h - Digital Mars
empty = CreateSemaphore(NULL, 2, 2, "_beginth_sema2");.......
http://www.digitalmars.com/rtl/process.html
TITLE : Examining Windows CE 3.0 Real-Time Capabilities | Dr Dobb's
HandleSemA = CreateSemaphore(NULL, 0, 1, NULL);.......
http://www.drdobbs.com/architecture-and-design/examining-windows-ce-30-real-time-capabi/184404887
TITLE : Examining Windows CE 3.0 Real-Time Capabilities | Dr Dobb's
HandleSemB = CreateSemaphore(NULL, 0, 1, NULL);.......
http://www.drdobbs.com/architecture-and-design/examining-windows-ce-30-real-time-capabi/184404887
TITLE : Migrate Win32 C/C++ applications to Linux on POWER, Part 3: Semaphores
semHandle = CreateSemaphore(NULL, 0, 256000, NULL);.......
http://www.ibm.com/developerworks/systems/library/es-win32linux-sem.html
TITLE : Migrate Win32 C/C++ applications to Linux on POWER, Part 3: Semaphores
semHandle = CreateSemaphore(NULL, 1, 65536, NULL);.......
http://www.ibm.com/developerworks/systems/library/es-win32linux-sem.html
TITLE : Migrate Win32 C/C++ applications to Linux on POWER, Part 3: Semaphores
semaphore = CreateSemaphore( &sec_attr, 1, 65536, ?456789" );.......
http://www.ibm.com/developerworks/systems/library/es-win32linux-sem.html
TITLE : Migrate Win32 C/C++ applications to Linux on POWER, Part 3: Semaphores
semaphore = CreateSemaphore( &sec_attr, 0, 65536, ?456789" );.......
http://www.ibm.com/developerworks/systems/library/es-win32linux-sem.html
TITLE : The Windows thread synchronization using Semaphores Win32 program example
sem_t = CreateSemaphore( NULL, 0, 1, lpszSemaphore );.......
http://www.installsetupconfig.com/win32programming/threadprocesssynchronizationapis11_44.html
TITLE : The Windows thread synchronization using Semaphores Win32 program example
wprintf(L"CreateSemaphore() - Semaphore initialization failed, error %u\n", GetLastError());.......
http://www.installsetupconfig.com/win32programming/threadprocesssynchronizationapis11_44.html
TITLE : The Windows thread synchronization using Semaphores Win32 program example
wprintf(L"CreateSemaphore() is OK!\n");.......
http://www.installsetupconfig.com/win32programming/threadprocesssynchronizationapis11_44.html

#define SEMAPHORE_INIT(A) do { A = CreateSemaphore(NULL, 0, 1, NULL); } while (0).......
http://www.mupdf.com/docs/browse/source/tools/mudraw.c
TITLE : locks
varsem=locks.createSemaphore(initialValue);.......
http://www.npmjs.com/package/locks
TITLE : PureBasic Forum • View topic - PureAudioRecorder, record 'Line In' audio, playback, save
audioSemaphore = CreateSemaphore(0).......
http://www.purebasic.fr/english/viewtopic.php@p=413509
TITLE : PureBasic Forum • View topic - PureAudioRecorder, record 'Line In' audio, playback, save
meterSemaphore = CreateSemaphore(0).......
http://www.purebasic.fr/english/viewtopic.php@p=413509
TITLE : PureBasic Forum • View topic - PureAudioRecorder, record 'Line In' audio, playback, save
audioSemaphore = CreateSemaphore(0).......
http://www.purebasic.fr/english/viewtopic.php@p=413509
TITLE : How do I write a screen saver? - Embarcadero: Delphi FAQ - Tek-Tips
MySem := CreateSemaphore(nil,0,1,'SSaverSemaphore');.......
http://www.tek-tips.com/faqs.cfm@fid=6914
TITLE : Using the semaphore object for thread synchronization
Using the CreateSemaphore() and the related functions for thread synchronization.......
http://www.tenouk.com/cpluscodesnippet/usingcreatesemaphorefunction.html
TITLE : Using the semaphore object for thread synchronization
hSemaphore = CreateSemaphore(.......
http://www.tenouk.com/cpluscodesnippet/usingcreatesemaphorefunction.html
TITLE : Using the semaphore object for thread synchronization
printf("CreateSemaphore() error: %d\n", GetLastError());.......
http://www.tenouk.com/cpluscodesnippet/usingcreatesemaphorefunction.html
TITLE : Using the semaphore object for thread synchronization
printf("CreateSemaphore() is OK\n");.......
http://www.tenouk.com/cpluscodesnippet/usingcreatesemaphorefunction.html
TITLE : Using the semaphore object for thread synchronization
CreateSemaphore() is OK.......
http://www.tenouk.com/cpluscodesnippet/usingcreatesemaphorefunction.html
TITLE : Using the semaphore object for thread synchronization
To do: Using the CreateSemaphore() related functions in C program example.......
http://www.tenouk.com/cpluscodesnippet/usingcreatesemaphorefunction.html
TITLE : Using the semaphore object for thread synchronization
First, it uses the CreateSemaphore() function to create the semaphore and to specify initial and maximum counts,.......
http://www.tenouk.com/cpluscodesnippet/usingnamedsemaphorefunction.html
TITLE : Using the semaphore object for thread synchronization
ghSemaphore = CreateSemaphore(.......
http://www.tenouk.com/cpluscodesnippet/usingnamedsemaphorefunction.html
TITLE : Using the semaphore object for thread synchronization
wprintf(L"CreateSemaphore()failed, error: %d\n", GetLastError());.......
http://www.tenouk.com/cpluscodesnippet/usingnamedsemaphorefunction.html
TITLE : Using the semaphore object for thread synchronization
wprintf(L"CreateSemaphore() should be fine!\n");.......
http://www.tenouk.com/cpluscodesnippet/usingnamedsemaphorefunction.html
TITLE : Using the semaphore object for thread synchronization
CreateSemaphore() should be fine!.......
http://www.tenouk.com/cpluscodesnippet/usingnamedsemaphorefunction.html
TITLE : A tutorial on Windows OS threads synchronization techniques and tricks used by Windows kernel with C program examples
The following example uses the CreateSemaphore() function to illustrate a named-object creation operation that fails if the object already exists........
http://www.tenouk.com/ModuleAA.html
TITLE : A tutorial on Windows OS threads synchronization techniques and tricks used by Windows kernel with C program examples
hSem = CreateSemaphore(.......
http://www.tenouk.com/ModuleAA.html
TITLE : A tutorial on Windows OS threads synchronization techniques and tricks used by Windows kernel with C program examples
In the following example, a process uses a semaphore object to limit the number of windows it creates. First, it uses the CreateSemaphore() function to create the semaphore and to specify initial and maximum counts........
http://www.tenouk.com/ModuleAA.html
TITLE : A tutorial on Windows OS threads synchronization techniques and tricks used by Windows kernel with C program examples
hSemaphore = CreateSemaphore(.......
http://www.tenouk.com/ModuleAA.html
TITLE : A tutorial on Windows OS threads synchronization techniques and tricks used by Windows kernel with C program examples
printf("CreateSemaphore() failed, error: %d.\n", GetLastError());.......
http://www.tenouk.com/ModuleAA.html
TITLE : A tutorial on Windows OS threads synchronization techniques and tricks used by Windows kernel with C program examples
printf("CreateSemaphore() is OK.\n");.......
http://www.tenouk.com/ModuleAA.html
TITLE : A tutorial on Windows OS threads synchronization techniques and tricks used by Windows kernel with C program examples
hSemaphore = CreateSemaphore(.......
http://www.tenouk.com/ModuleAA.html
TITLE : A tutorial on Windows OS threads synchronization techniques and tricks used by Windows kernel with C program examples
printf("CreateSemaphore() failed error: %d.\n", GetLastError());.......
http://www.tenouk.com/ModuleAA.html
TITLE : A tutorial on Windows OS threads synchronization techniques and tricks used by Windows kernel with C program examples
printf("CreateSemaphore() is OK.\n");.......
http://www.tenouk.com/ModuleAA.html
TITLE : VC++ Article, CListCtrl, CListView to displaying, jpeg image thumbnails, PaintLib, CreateThread
imageFillerSemaphore=CreateSemaphore(NULL, 0,1, NULL);.......
http://www.ucancode.net/VC_Library_Control_Tool/VC-Article-CListCtrl-CListView-Display-jpeg-image-thumbnails.htm
TITLE : VC++ Article, CListCtrl, CListView to displaying, jpeg image thumbnails, PaintLib, CreateThread
imageFillerCR=CreateSemaphore(NULL, 1,1, NULL);.......
http://www.ucancode.net/VC_Library_Control_Tool/VC-Article-CListCtrl-CListView-Display-jpeg-image-thumbnails.htm
TITLE : VC++ Article, CListCtrl, CListView to displaying, jpeg image thumbnails, PaintLib, CreateThread
imageFillerWait=CreateSemaphore(NULL, 1,1, NULL);.......
http://www.ucancode.net/VC_Library_Control_Tool/VC-Article-CListCtrl-CListView-Display-jpeg-image-thumbnails.htm
TITLE : MSDN Home
sem_t = CreateSemaphore( NULL, 0, 1, lpszSemaphore );.......
http://www.zemris.fer.hr/~leonardo/os/math/labosi/pripreme/upute/misc/Unix2Win.htm
TITLE : MSDN Home
hSemaphore = CreateSemaphore( NULL, 1, 1, lpszSemaphore );.......
http://www.zemris.fer.hr/~leonardo/os/math/labosi/pripreme/upute/misc/Unix2Win.htm
search Google

https://www.google.com/#q=CreateSemaphore