diff options
author | dmasloff <dmasloff@yandex-team.com> | 2024-08-17 23:33:42 +0300 |
---|---|---|
committer | dmasloff <dmasloff@yandex-team.com> | 2024-08-17 23:43:45 +0300 |
commit | 69340f4614e853b9319df4b454ab7497711ee3cd (patch) | |
tree | 9902a3e2f58fe0bd9a157e7b51ad1cc52efa5744 /util/system/sem.cpp | |
parent | a905b53ec410defd5d2c40031ef8b34bb50a29f8 (diff) | |
download | ydb-69340f4614e853b9319df4b454ab7497711ee3cd.tar.gz |
Set SpacesInLineCommentPrefix to 1 in /util
Set SpacesInLineCommentPrefix to 1 in /util
3853f9ec5143722c1bebd8dc0ffc9b61a6c17657
Diffstat (limited to 'util/system/sem.cpp')
-rw-r--r-- | util/system/sem.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/util/system/sem.cpp b/util/system/sem.cpp index 1825ac3093..96affec792 100644 --- a/util/system/sem.cpp +++ b/util/system/sem.cpp @@ -16,7 +16,7 @@ #if defined(_bionic_) || defined(_darwin_) && defined(_arm_) #include <fcntl.h> #else - #define USE_SYSV_SEMAPHORES //unixoids declared the standard but not implemented it... + #define USE_SYSV_SEMAPHORES // unixoids declared the standard but not implemented it... #endif #endif @@ -83,7 +83,7 @@ namespace { Handle = ::CreateSemaphore(0, max_free_count, max_free_count, key); #else #ifdef USE_SYSV_SEMAPHORES - key_t key = TPCGMixer::Mix(CityHash64(name, strlen(name))); //32 bit hash + key_t key = TPCGMixer::Mix(CityHash64(name, strlen(name))); // 32 bit hash Handle = semget(key, 0, 0); // try to open exist semaphore if (Handle == -1) { // create new semaphore Handle = semget(key, 1, 0666 | IPC_CREAT); @@ -110,8 +110,8 @@ namespace { #else #ifdef USE_SYSV_SEMAPHORES // we DO NOT want 'semctl(Handle, 0, IPC_RMID)' for multiprocess tasks; - //struct sembuf ops[] = {{0, 0, IPC_NOWAIT}}; - //if (semop(Handle, ops, 1) != 0) // close only if semaphore's value is zero + // struct sembuf ops[] = {{0, 0, IPC_NOWAIT}}; + // if (semop(Handle, ops, 1) != 0) // close only if semaphore's value is zero // semctl(Handle, 0, IPC_RMID); #else sem_close(Handle); // we DO NOT want sem_unlink(...) @@ -133,8 +133,8 @@ namespace { #endif } - //The UNIX semaphore object does not support a timed "wait", and - //hence to maintain consistancy, for win32 case we use INFINITE or 0 timeout. + // The UNIX semaphore object does not support a timed "wait", and + // hence to maintain consistancy, for win32 case we use INFINITE or 0 timeout. inline void Acquire() noexcept { #ifdef _win_ Y_ABORT_UNLESS(::WaitForSingleObject(Handle, INFINITE) == WAIT_OBJECT_0, "can not acquire semaphore"); |