diff options
author | loudhorr <loudhorr@yandex-team.ru> | 2022-02-10 16:46:26 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:26 +0300 |
commit | cda908cacb24be13e419866da89ff4fbeea31f89 (patch) | |
tree | cc0bc607920fb1192332619d57eb874402a23bff | |
parent | 48030071922c430b2b2ffbf612d75c7afbf7a2c0 (diff) | |
download | ydb-cda908cacb24be13e419866da89ff4fbeea31f89.tar.gz |
Restoring authorship annotation for <loudhorr@yandex-team.ru>. Commit 1 of 2.
-rw-r--r-- | build/rules/contrib_restricted.policy | 2 | ||||
-rw-r--r-- | build/rules/maps/maps.policy | 4 | ||||
-rw-r--r-- | contrib/libs/poco/Foundation/src/FileChannel.cpp | 10 | ||||
-rw-r--r-- | contrib/libs/poco/Net/ya.make | 2 | ||||
-rw-r--r-- | contrib/restricted/boost/boost/test/impl/compiler_log_formatter.ipp | 2 | ||||
-rw-r--r-- | contrib/restricted/boost/boost/test/impl/junit_log_formatter.ipp | 8 | ||||
-rw-r--r-- | util/system/file_lock.cpp | 32 | ||||
-rw-r--r-- | util/system/file_lock.h | 22 | ||||
-rw-r--r-- | util/system/flock_ut.cpp | 66 | ||||
-rw-r--r-- | util/thread/pool.cpp | 4 |
10 files changed, 76 insertions, 76 deletions
diff --git a/build/rules/contrib_restricted.policy b/build/rules/contrib_restricted.policy index a83ead1904..de46f10d87 100644 --- a/build/rules/contrib_restricted.policy +++ b/build/rules/contrib_restricted.policy @@ -153,7 +153,7 @@ ALLOW yabs/telephony -> contrib/restricted/boost ALLOW yandex_io -> contrib/restricted/boost ALLOW yweb/robot/js -> contrib/restricted/boost ALLOW market/access/server/env -> contrib/restricted/boost -ALLOW sdg/library/cpp/ros_msg_parser -> contrib/restricted/boost +ALLOW sdg/library/cpp/ros_msg_parser -> contrib/restricted/boost ALLOW search/meta/scatter/ant -> contrib/restricted/boost ALLOW search/meta/scatter/ut -> contrib/restricted/boost diff --git a/build/rules/maps/maps.policy b/build/rules/maps/maps.policy index 8abf3fbbd7..3c30ba3c1e 100644 --- a/build/rules/maps/maps.policy +++ b/build/rules/maps/maps.policy @@ -162,8 +162,8 @@ ALLOW maps_adv/ -> maps_adv/ ALLOW smb/ -> maps_adv/ DENY .* -> maps_adv/ -ALLOW sdg/library/python/revision_manager -> maps/wikimap/mapspro/libs/common -ALLOW sdg/library/python/revision_manager -> maps/wikimap/mapspro/libs/revision +ALLOW sdg/library/python/revision_manager -> maps/wikimap/mapspro/libs/common +ALLOW sdg/library/python/revision_manager -> maps/wikimap/mapspro/libs/revision # Ydo libs can use some maps stuff ALLOW ydo/libs/dispatch -> maps/libs/pbstream diff --git a/contrib/libs/poco/Foundation/src/FileChannel.cpp b/contrib/libs/poco/Foundation/src/FileChannel.cpp index c2b2f6ee88..2148154a8d 100644 --- a/contrib/libs/poco/Foundation/src/FileChannel.cpp +++ b/contrib/libs/poco/Foundation/src/FileChannel.cpp @@ -126,7 +126,7 @@ void FileChannel::log(const Message& msg) { _pFile->write(msg.getText(), _flush); } - catch (const WriteFileException &) + catch (const WriteFileException &) { // In case of no space left on device, // we try to purge old files or truncate current file. @@ -139,10 +139,10 @@ void FileChannel::log(const Message& msg) { PurgeOneFileStrategy().purge(_path); } - - delete _pFile; - _pFile = 0; - _pFile = new LogFile(_path); + + delete _pFile; + _pFile = 0; + _pFile = new LogFile(_path); } } diff --git a/contrib/libs/poco/Net/ya.make b/contrib/libs/poco/Net/ya.make index 9feadc7027..4bdace0995 100644 --- a/contrib/libs/poco/Net/ya.make +++ b/contrib/libs/poco/Net/ya.make @@ -33,7 +33,7 @@ CFLAGS( -DPOCO_SOCKETADDRESS_DONT_PREFER_IPV4 ) -IF (OS_LINUX) +IF (OS_LINUX) CFLAGS( -DPOCO_HAVE_FD_EPOLL ) diff --git a/contrib/restricted/boost/boost/test/impl/compiler_log_formatter.ipp b/contrib/restricted/boost/boost/test/impl/compiler_log_formatter.ipp index aa0a0e229f..ebc8ec2b99 100644 --- a/contrib/restricted/boost/boost/test/impl/compiler_log_formatter.ipp +++ b/contrib/restricted/boost/boost/test/impl/compiler_log_formatter.ipp @@ -282,7 +282,7 @@ compiler_log_formatter::entry_context_finish( std::ostream& output, log_level l //____________________________________________________________________________// void -compiler_log_formatter::log_entry_context( std::ostream& output, log_level /*l*/, const_string context_descr ) +compiler_log_formatter::log_entry_context( std::ostream& output, log_level /*l*/, const_string context_descr ) { output << "\n " << context_descr; } diff --git a/contrib/restricted/boost/boost/test/impl/junit_log_formatter.ipp b/contrib/restricted/boost/boost/test/impl/junit_log_formatter.ipp index 0f7a8f4c51..13d2a7ec39 100644 --- a/contrib/restricted/boost/boost/test/impl/junit_log_formatter.ipp +++ b/contrib/restricted/boost/boost/test/impl/junit_log_formatter.ipp @@ -528,8 +528,8 @@ junit_log_formatter::test_unit_start( std::ostream& /*ostr*/, test_unit const& t void junit_log_formatter::test_unit_finish( std::ostream& /*ostr*/, test_unit const& tu, unsigned long /*elapsed*/ ) { - (void) tu; // unused when asserts are turned off - + (void) tu; // unused when asserts are turned off + // the time is already stored in the result_reporter assert( tu.p_id == list_path_to_root.back() ); list_path_to_root.pop_back(); @@ -538,8 +538,8 @@ junit_log_formatter::test_unit_finish( std::ostream& /*ostr*/, test_unit const& void junit_log_formatter::test_unit_aborted( std::ostream& /*ostr*/, test_unit const& tu ) { - (void) tu; // unused when asserts are turned off - + (void) tu; // unused when asserts are turned off + assert( tu.p_id == list_path_to_root.back() ); //list_path_to_root.pop_back(); } diff --git a/util/system/file_lock.cpp b/util/system/file_lock.cpp index 45d91282c5..ef8c10a190 100644 --- a/util/system/file_lock.cpp +++ b/util/system/file_lock.cpp @@ -5,33 +5,33 @@ #include <cerrno> -namespace { - int GetMode(const EFileLockType type) { - switch (type) { - case EFileLockType::Exclusive: - return LOCK_EX; - case EFileLockType::Shared: - return LOCK_SH; +namespace { + int GetMode(const EFileLockType type) { + switch (type) { + case EFileLockType::Exclusive: + return LOCK_EX; + case EFileLockType::Shared: + return LOCK_SH; default: Y_UNREACHABLE(); - } + } Y_UNREACHABLE(); - } -} - -TFileLock::TFileLock(const TString& filename, const EFileLockType type) - : TFile(filename, OpenAlways | RdOnly) - , Type(type) + } +} + +TFileLock::TFileLock(const TString& filename, const EFileLockType type) + : TFile(filename, OpenAlways | RdOnly) + , Type(type) { } void TFileLock::Acquire() { - Flock(GetMode(Type)); + Flock(GetMode(Type)); } bool TFileLock::TryAcquire() { try { - Flock(GetMode(Type) | LOCK_NB); + Flock(GetMode(Type) | LOCK_NB); return true; } catch (const TSystemError& e) { if (e.Status() != EWOULDBLOCK) { diff --git a/util/system/file_lock.h b/util/system/file_lock.h index b2aaff5baf..f9b7891fef 100644 --- a/util/system/file_lock.h +++ b/util/system/file_lock.h @@ -5,18 +5,18 @@ #include <util/system/file.h> enum class EFileLockType { - Exclusive, - Shared -}; - -class TFileLock: public TFile { -public: - TFileLock(const TString& filename, const EFileLockType type = EFileLockType::Exclusive); - + Exclusive, + Shared +}; + +class TFileLock: public TFile { +public: + TFileLock(const TString& filename, const EFileLockType type = EFileLockType::Exclusive); + void Acquire(); bool TryAcquire(); void Release(); - + inline void lock() { Acquire(); } @@ -29,6 +29,6 @@ public: Release(); } -private: - EFileLockType Type; +private: + EFileLockType Type; }; diff --git a/util/system/flock_ut.cpp b/util/system/flock_ut.cpp index b5f6cb5328..83f1ad11ef 100644 --- a/util/system/flock_ut.cpp +++ b/util/system/flock_ut.cpp @@ -15,43 +15,43 @@ Y_UNIT_TEST_SUITE(TFileLockTest) { Y_UNIT_TEST(TestFileLocker) { TTempFileHandle tmp("./file.locker"); - TFileLock fileLockExclusive1("./file.locker"); - TFileLock fileLockExclusive2("./file.locker"); - TFileLock fileLockShared1("./file.locker", EFileLockType::Shared); - TFileLock fileLockShared2("./file.locker", EFileLockType::Shared); - TFileLock fileLockShared3("./file.locker", EFileLockType::Shared); + TFileLock fileLockExclusive1("./file.locker"); + TFileLock fileLockExclusive2("./file.locker"); + TFileLock fileLockShared1("./file.locker", EFileLockType::Shared); + TFileLock fileLockShared2("./file.locker", EFileLockType::Shared); + TFileLock fileLockShared3("./file.locker", EFileLockType::Shared); { - TGuard<TFileLock> guard(fileLockExclusive1); + TGuard<TFileLock> guard(fileLockExclusive1); } { - TTryGuard<TFileLock> tryGuard(fileLockExclusive1); + TTryGuard<TFileLock> tryGuard(fileLockExclusive1); UNIT_ASSERT(tryGuard.WasAcquired()); } - { - TGuard<TFileLock> guard1(fileLockExclusive1); - TTryGuard<TFileLock> guard2(fileLockExclusive2); - UNIT_ASSERT(!guard2.WasAcquired()); - } - { - TGuard<TFileLock> guard1(fileLockShared1); - TTryGuard<TFileLock> guard2(fileLockShared2); - TTryGuard<TFileLock> guard3(fileLockShared3); - UNIT_ASSERT(guard2.WasAcquired()); - UNIT_ASSERT(guard3.WasAcquired()); - } - { - TGuard<TFileLock> guard1(fileLockExclusive1); - TTryGuard<TFileLock> guard2(fileLockShared1); - TTryGuard<TFileLock> guard3(fileLockShared2); - UNIT_ASSERT(!guard2.WasAcquired()); - UNIT_ASSERT(!guard3.WasAcquired()); - } - { - TGuard<TFileLock> guard1(fileLockShared1); - TTryGuard<TFileLock> guard2(fileLockExclusive1); - TTryGuard<TFileLock> guard3(fileLockShared2); - UNIT_ASSERT(!guard2.WasAcquired()); - UNIT_ASSERT(guard3.WasAcquired()); - } + { + TGuard<TFileLock> guard1(fileLockExclusive1); + TTryGuard<TFileLock> guard2(fileLockExclusive2); + UNIT_ASSERT(!guard2.WasAcquired()); + } + { + TGuard<TFileLock> guard1(fileLockShared1); + TTryGuard<TFileLock> guard2(fileLockShared2); + TTryGuard<TFileLock> guard3(fileLockShared3); + UNIT_ASSERT(guard2.WasAcquired()); + UNIT_ASSERT(guard3.WasAcquired()); + } + { + TGuard<TFileLock> guard1(fileLockExclusive1); + TTryGuard<TFileLock> guard2(fileLockShared1); + TTryGuard<TFileLock> guard3(fileLockShared2); + UNIT_ASSERT(!guard2.WasAcquired()); + UNIT_ASSERT(!guard3.WasAcquired()); + } + { + TGuard<TFileLock> guard1(fileLockShared1); + TTryGuard<TFileLock> guard2(fileLockExclusive1); + TTryGuard<TFileLock> guard3(fileLockShared2); + UNIT_ASSERT(!guard2.WasAcquired()); + UNIT_ASSERT(guard3.WasAcquired()); + } } } diff --git a/util/thread/pool.cpp b/util/thread/pool.cpp index 05fad02e9b..28606262c6 100644 --- a/util/thread/pool.cpp +++ b/util/thread/pool.cpp @@ -1,5 +1,5 @@ -#include <atomic> - +#include <atomic> + #include <util/system/defaults.h> #if defined(_unix_) |