Advertisement
Bkmz

Untitled

Jan 11th, 2012
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. // Semaphore_test.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include <stdio.h>
  5. #include <Windows.h>
  6. #include <fcntl.h>
  7.  
  8.  
  9. int main()
  10. {
  11. HANDLE sem = CreateSemaphore(NULL, 1, 1, (LPCWSTR)"file_locker");
  12.  
  13. WaitForSingleObject(sem, INFINITE);
  14.  
  15. system("PAUSE");
  16. return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement