Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Semaphore_test.cpp : Defines the entry point for the console application.
- //
- #include <stdio.h>
- #include <Windows.h>
- #include <fcntl.h>
- int main()
- {
- HANDLE sem = CreateSemaphore(NULL, 1, 1, (LPCWSTR)"file_locker");
- WaitForSingleObject(sem, INFINITE);
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement