| 1 | /* -*- C++ -*- */cxx . . $ `<file>/vendor/Heap-Layers/locks/posixlock.h`/ |
| 2 | |
| 3 | /* |
| 4 | |
| 5 | Heap Layers: An Extensible Memory Allocation Infrastructure |
| 6 | |
| 7 | Copyright (C) 2000-2020 by Emery Berger |
| 8 | http://www.emeryberger.com |
| 9 | [email protected] |
| 10 | |
| 11 | Heap Layers is distributed under the terms of the Apache 2.0 license. |
| 12 | |
| 13 | You may obtain a copy of the License at |
| 14 | http://www.apache.org/licenses/LICENSE-2.0 |
| 15 | |
| 16 | */ |
| 17 | |
| 18 | #ifndef HL_POSIXLOCK_H |
| 19 | #define HL_POSIXLOCK_Hcxx . . $ `vendor/Heap-Layers/locks/posixlock.h:19:9`! |
| 20 | |
| 21 | #if !defined(_WIN32) |
| 22 | |
| 23 | #include <pthread.h> |
| 24 | |
| 25 | /** |
| 26 | * @class PosixLockType |
| 27 | * @brief Locking using POSIX mutex objects. |
| 28 | */ |
| 29 | |
| 30 | namespace HLcxx . . $ HL/ { |
| 31 | |
| 32 | class PosixLockTypecxx . . $ HL/PosixLockType# { |
| 33 | public: |
| 34 | |
| 35 | PosixLockTypecxx . . $ HL/PosixLockType#PosixLockType(49f6e7a06ebc5aa8). (void) |
| 36 | { |
| 37 | int r = pthread_mutex_init (&mutexcxx . . $ HL/PosixLockType#$anonymous_type_0#mutex., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 38 | if (r) { |
| 39 | throw 0; |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | ~cxx . . $ HL/PosixLockType#`~PosixLockType`(49f6e7a06ebc5aa8).PosixLockTypecxx . . $ HL/PosixLockType# (void) |
| 44 | { |
| 45 | pthread_mutex_destroy (&mutexcxx . . $ HL/PosixLockType#$anonymous_type_0#mutex.); |
| 46 | } |
| 47 | |
| 48 | void lockcxx . . $ HL/PosixLockType#lock(49f6e7a06ebc5aa8). (void) { |
| 49 | pthread_mutex_lock (&mutexcxx . . $ HL/PosixLockType#$anonymous_type_0#mutex.); |
| 50 | } |
| 51 | |
| 52 | void unlockcxx . . $ HL/PosixLockType#unlock(49f6e7a06ebc5aa8). (void) { |
| 53 | pthread_mutex_unlock (&mutexcxx . . $ HL/PosixLockType#$anonymous_type_0#mutex.); |
| 54 | } |
| 55 | |
| 56 | private: |
| 57 | unioncxx . . $ HL/PosixLockType#$anonymous_type_0# { |
| 58 | pthread_mutex_t mutexcxx . . $ HL/PosixLockType#$anonymous_type_0#mutex.; |
| 59 | double _dummycxx . . $ HL/PosixLockType#$anonymous_type_0#_dummy.[sizeof(pthread_mutex_t)/sizeof(double) + 1]; |
| 60 | }; |
| 61 | }; |
| 62 | |
| 63 | typedef PosixLockTypecxx . . $ HL/PosixLockType# PosixLockcxx . . $ HL/PosixLock#; |
| 64 | |
| 65 | } |
| 66 | |
| 67 | #endif |
| 68 | |
| 69 | #endif |