- a0673e81da7ee7e322283e518331a4cdaeca837b Internal change by Abseil Team <absl-team@google.com>
- 537e863510a423968c2d319263dd1c100695a2e9 Add internal-only functionality to examine the stack, to ... by Derek Mauro <dmauro@google.com> - 1ded12406d8b8fd7be910c8dfe8c2a8edf66136e Explicitly suppress the default move constructor and assi... by Derek Mauro <dmauro@google.com> - 347d38447ebc38e5d33fec6b67988880eb3cd249 Move implementation detail do_mmap64 to a new file. by Greg Falcon <gfalcon@google.com> GitOrigin-RevId: a0673e81da7ee7e322283e518331a4cdaeca837b Change-Id: I5a347d34d5173082b3a78eb53432481b32c94b69
This commit is contained in:
parent
475d64f2de
commit
a7e522daf1
5 changed files with 186 additions and 88 deletions
|
|
@ -519,11 +519,16 @@ class SCOPED_LOCKABLE MutexLock {
|
|||
explicit MutexLock(Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu) : mu_(mu) {
|
||||
this->mu_->Lock();
|
||||
}
|
||||
|
||||
MutexLock(const MutexLock &) = delete; // NOLINT(runtime/mutex)
|
||||
MutexLock(MutexLock&&) = delete; // NOLINT(runtime/mutex)
|
||||
MutexLock& operator=(const MutexLock&) = delete;
|
||||
MutexLock& operator=(MutexLock&&) = delete;
|
||||
|
||||
~MutexLock() UNLOCK_FUNCTION() { this->mu_->Unlock(); }
|
||||
|
||||
private:
|
||||
Mutex *const mu_;
|
||||
MutexLock(const MutexLock &) = delete; // NOLINT(runtime/mutex)
|
||||
MutexLock& operator=(const MutexLock&) = delete;
|
||||
};
|
||||
|
||||
// ReaderMutexLock
|
||||
|
|
@ -536,13 +541,18 @@ class SCOPED_LOCKABLE ReaderMutexLock {
|
|||
: mu_(mu) {
|
||||
mu->ReaderLock();
|
||||
}
|
||||
|
||||
ReaderMutexLock(const ReaderMutexLock&) = delete;
|
||||
ReaderMutexLock(ReaderMutexLock&&) = delete;
|
||||
ReaderMutexLock& operator=(const ReaderMutexLock&) = delete;
|
||||
ReaderMutexLock& operator=(ReaderMutexLock&&) = delete;
|
||||
|
||||
~ReaderMutexLock() UNLOCK_FUNCTION() {
|
||||
this->mu_->ReaderUnlock();
|
||||
}
|
||||
|
||||
private:
|
||||
Mutex *const mu_;
|
||||
ReaderMutexLock(const ReaderMutexLock&) = delete;
|
||||
ReaderMutexLock& operator=(const ReaderMutexLock&) = delete;
|
||||
};
|
||||
|
||||
// WriterMutexLock
|
||||
|
|
@ -555,13 +565,18 @@ class SCOPED_LOCKABLE WriterMutexLock {
|
|||
: mu_(mu) {
|
||||
mu->WriterLock();
|
||||
}
|
||||
|
||||
WriterMutexLock(const WriterMutexLock&) = delete;
|
||||
WriterMutexLock(WriterMutexLock&&) = delete;
|
||||
WriterMutexLock& operator=(const WriterMutexLock&) = delete;
|
||||
WriterMutexLock& operator=(WriterMutexLock&&) = delete;
|
||||
|
||||
~WriterMutexLock() UNLOCK_FUNCTION() {
|
||||
this->mu_->WriterUnlock();
|
||||
}
|
||||
|
||||
private:
|
||||
Mutex *const mu_;
|
||||
WriterMutexLock(const WriterMutexLock&) = delete;
|
||||
WriterMutexLock& operator=(const WriterMutexLock&) = delete;
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
@ -834,7 +849,9 @@ class SCOPED_LOCKABLE MutexLockMaybe {
|
|||
private:
|
||||
Mutex *const mu_;
|
||||
MutexLockMaybe(const MutexLockMaybe&) = delete;
|
||||
MutexLockMaybe(MutexLockMaybe&&) = delete;
|
||||
MutexLockMaybe& operator=(const MutexLockMaybe&) = delete;
|
||||
MutexLockMaybe& operator=(MutexLockMaybe&&) = delete;
|
||||
};
|
||||
|
||||
// ReleaseableMutexLock
|
||||
|
|
@ -856,7 +873,9 @@ class SCOPED_LOCKABLE ReleasableMutexLock {
|
|||
private:
|
||||
Mutex *mu_;
|
||||
ReleasableMutexLock(const ReleasableMutexLock&) = delete;
|
||||
ReleasableMutexLock(ReleasableMutexLock&&) = delete;
|
||||
ReleasableMutexLock& operator=(const ReleasableMutexLock&) = delete;
|
||||
ReleasableMutexLock& operator=(ReleasableMutexLock&&) = delete;
|
||||
};
|
||||
|
||||
#ifdef ABSL_INTERNAL_USE_NONPROD_MUTEX
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue