diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:49 +0300 |
commit | 718c552901d703c502ccbefdfc3c9028d608b947 (patch) | |
tree | 46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/libs/poco/Foundation/src/NamedEvent_WIN32U.cpp | |
parent | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff) | |
download | ydb-718c552901d703c502ccbefdfc3c9028d608b947.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/poco/Foundation/src/NamedEvent_WIN32U.cpp')
-rw-r--r-- | contrib/libs/poco/Foundation/src/NamedEvent_WIN32U.cpp | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/contrib/libs/poco/Foundation/src/NamedEvent_WIN32U.cpp b/contrib/libs/poco/Foundation/src/NamedEvent_WIN32U.cpp index 8a7ad1c182..6d043f3360 100644 --- a/contrib/libs/poco/Foundation/src/NamedEvent_WIN32U.cpp +++ b/contrib/libs/poco/Foundation/src/NamedEvent_WIN32U.cpp @@ -1,63 +1,63 @@ -// -// NamedEvent_WIN32.cpp -// -// Library: Foundation -// Package: Processes -// Module: NamedEvent -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/NamedEvent_WIN32U.h" -#include "Poco/Error.h" -#include "Poco/Exception.h" -#include "Poco/Format.h" -#include "Poco/UnicodeConverter.h" - - -namespace Poco { - - -NamedEventImpl::NamedEventImpl(const std::string& name): - _name(name) -{ - UnicodeConverter::toUTF16(_name, _uname); - _event = CreateEventW(NULL, FALSE, FALSE, _uname.c_str()); - if (!_event) - { - DWORD dwRetVal = GetLastError(); - throw SystemException(format("cannot create named event %s [Error %d: %s]", _name, (int)dwRetVal, Error::getMessage(dwRetVal))); - } -} - - -NamedEventImpl::~NamedEventImpl() -{ - CloseHandle(_event); -} - - -void NamedEventImpl::setImpl() -{ - if (!SetEvent(_event)) - throw SystemException("cannot signal named event", _name); -} - - -void NamedEventImpl::waitImpl() -{ - switch (WaitForSingleObject(_event, INFINITE)) - { - case WAIT_OBJECT_0: - return; - default: - throw SystemException("wait for named event failed", _name); - } -} - - -} // namespace Poco +// +// NamedEvent_WIN32.cpp +// +// Library: Foundation +// Package: Processes +// Module: NamedEvent +// +// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. +// and Contributors. +// +// SPDX-License-Identifier: BSL-1.0 +// + + +#include "Poco/NamedEvent_WIN32U.h" +#include "Poco/Error.h" +#include "Poco/Exception.h" +#include "Poco/Format.h" +#include "Poco/UnicodeConverter.h" + + +namespace Poco { + + +NamedEventImpl::NamedEventImpl(const std::string& name): + _name(name) +{ + UnicodeConverter::toUTF16(_name, _uname); + _event = CreateEventW(NULL, FALSE, FALSE, _uname.c_str()); + if (!_event) + { + DWORD dwRetVal = GetLastError(); + throw SystemException(format("cannot create named event %s [Error %d: %s]", _name, (int)dwRetVal, Error::getMessage(dwRetVal))); + } +} + + +NamedEventImpl::~NamedEventImpl() +{ + CloseHandle(_event); +} + + +void NamedEventImpl::setImpl() +{ + if (!SetEvent(_event)) + throw SystemException("cannot signal named event", _name); +} + + +void NamedEventImpl::waitImpl() +{ + switch (WaitForSingleObject(_event, INFINITE)) + { + case WAIT_OBJECT_0: + return; + default: + throw SystemException("wait for named event failed", _name); + } +} + + +} // namespace Poco |