icl_core_logging/SemaphoreImplWin32.cpp
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // This file is part of FZIs ic_workspace.
5 //
6 // This program is free software licensed under the LGPL
7 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
8 // You can find a copy of this license in LICENSE folder in the top
9 // directory of the source code.
10 //
11 // © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany
12 //
13 // -- END LICENSE BLOCK ------------------------------------------------
14 
15 //----------------------------------------------------------------------
21 //----------------------------------------------------------------------
22 #include "SemaphoreImplWin32.h"
23 
24 namespace icl_core {
25 namespace logging {
26 
28  : m_semaphore(NULL)
29 {
30  m_semaphore = CreateSemaphore(NULL, LONG(initial_value), LONG_MAX, NULL);
31 }
32 
34 {
35  CloseHandle(m_semaphore);
36 }
37 
39 {
40  ReleaseSemaphore(m_semaphore, 1, NULL);
41 }
42 
44 {
45  DWORD res = WaitForSingleObject(m_semaphore, INFINITE);
46  return res == WAIT_OBJECT_0;
47 }
48 
49 }
50 }
Contains icl_core::thread::SemaphoreImplWin32.


fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:58