winpr/libwinpr/synch/test/TestSynchSemaphore.c
raw| 1 | |
| 2 | #include <winpr/crt.h> |
| 3 | #include <winpr/synch.h> |
| 4 | |
| 5 | int TestSynchSemaphore(int argc, char* argv[]) |
| 6 | { |
| 7 | HANDLE semaphore = nullptr; |
| 8 | WINPR_UNUSED(argc); |
| 9 | WINPR_UNUSED(argv); |
| 10 | semaphore = CreateSemaphore(nullptr, 0, 1, nullptr); |
| 11 | |
| 12 | if (!semaphore) |
| 13 | { |
| 14 | printf("CreateSemaphore failure\n"); |
| 15 | return -1; |
| 16 | } |
| 17 | |
| 18 | (void)CloseHandle(semaphore); |
| 19 | |
| 20 | return 0; |
| 21 | } |