MCPcopy Create free account
hub / github.com/apache/trafficserver / Lock

Class Lock

plugins/experimental/inliner/ts.h:116–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114 using WriteOperationWeakPointer = std::weak_ptr<WriteOperation>;
115
116 struct Lock {
117 const TSMutex mutex_ = nullptr;
118
119 ~Lock()
120 {
121 if (mutex_ != nullptr) {
122 TSMutexUnlock(mutex_);
123 }
124 }
125
126 Lock(const TSMutex m) : mutex_(m)
127 {
128 if (mutex_ != nullptr) {
129 TSMutexLock(mutex_);
130 }
131 }
132
133 // noncopyable
134 Lock() {}
135 Lock(const Lock &) = delete;
136
137 Lock(Lock &&l) : mutex_(l.mutex_) { const_cast<TSMutex &>(l.mutex_) = nullptr; }
138 Lock &operator=(const Lock &) = delete;
139 };
140
141 struct WriteOperation : std::enable_shared_from_this<WriteOperation> {
142 TSVConn vconnection_;

Callers 1

lockMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected