aboutsummaryrefslogtreecommitdiffstats
path: root/components/remutex
diff options
context:
space:
mode:
authorDexter Haslem <dexter.haslem@gmail.com>2017-01-18 22:10:59 -0700
committerDexter Haslem <dexter.haslem@gmail.com>2017-01-18 22:21:41 -0700
commit94f0ceb4aa42c5a493523cb2f0a79d511b2b9caf (patch)
treeb1f686744f317933e2838db11e3f465fc86b25dd /components/remutex
parent5e888b5504a9daad86663837ca9e996d63a48821 (diff)
downloadservo-94f0ceb4aa42c5a493523cb2f0a79d511b2b9caf.tar.gz
servo-94f0ceb4aa42c5a493523cb2f0a79d511b2b9caf.zip
squash: convert less interesting debug! logs to traces
Diffstat (limited to 'components/remutex')
-rw-r--r--components/remutex/lib.rs28
1 files changed, 14 insertions, 14 deletions
diff --git a/components/remutex/lib.rs b/components/remutex/lib.rs
index b2ea30d11a4..683dcc99c74 100644
--- a/components/remutex/lib.rs
+++ b/components/remutex/lib.rs
@@ -159,7 +159,7 @@ unsafe impl<T> Sync for ReentrantMutex<T> where T: Send {}
impl<T> ReentrantMutex<T> {
pub fn new(data: T) -> ReentrantMutex<T> {
- debug!("{:?} Creating new lock.", ThreadId::current());
+ trace!("{:?} Creating new lock.", ThreadId::current());
ReentrantMutex {
mutex: HandOverHandMutex::new(),
count: Cell::new(0),
@@ -168,53 +168,53 @@ impl<T> ReentrantMutex<T> {
}
pub fn lock(&self) -> LockResult<ReentrantMutexGuard<T>> {
- debug!("{:?} Locking.", ThreadId::current());
+ trace!("{:?} Locking.", ThreadId::current());
if self.mutex.owner() != Some(ThreadId::current()) {
- debug!("{:?} Becoming owner.", ThreadId::current());
+ trace!("{:?} Becoming owner.", ThreadId::current());
if let Err(_) = self.mutex.lock() {
- debug!("{:?} Poison!", ThreadId::current());
+ trace!("{:?} Poison!", ThreadId::current());
return Err(PoisonError::new(self.mk_guard()));
}
- debug!("{:?} Became owner.", ThreadId::current());
+ trace!("{:?} Became owner.", ThreadId::current());
}
Ok(self.mk_guard())
}
pub fn try_lock(&self) -> TryLockResult<ReentrantMutexGuard<T>> {
- debug!("{:?} Try locking.", ThreadId::current());
+ trace!("{:?} Try locking.", ThreadId::current());
if self.mutex.owner() != Some(ThreadId::current()) {
- debug!("{:?} Becoming owner?", ThreadId::current());
+ trace!("{:?} Becoming owner?", ThreadId::current());
if let Err(err) = self.mutex.try_lock() {
match err {
TryLockError::WouldBlock => {
- debug!("{:?} Would block.", ThreadId::current());
+ trace!("{:?} Would block.", ThreadId::current());
return Err(TryLockError::WouldBlock)
},
TryLockError::Poisoned(_) => {
- debug!("{:?} Poison!", ThreadId::current());
+ trace!("{:?} Poison!", ThreadId::current());
return Err(TryLockError::Poisoned(PoisonError::new(self.mk_guard())));
},
}
}
- debug!("{:?} Became owner.", ThreadId::current());
+ trace!("{:?} Became owner.", ThreadId::current());
}
Ok(self.mk_guard())
}
fn unlock(&self) {
- debug!("{:?} Unlocking.", ThreadId::current());
+ trace!("{:?} Unlocking.", ThreadId::current());
let count = self.count.get().checked_sub(1).expect("Underflowed lock count.");
- debug!("{:?} Decrementing count to {}.", ThreadId::current(), count);
+ trace!("{:?} Decrementing count to {}.", ThreadId::current(), count);
self.count.set(count);
if count == 0 {
- debug!("{:?} Releasing mutex.", ThreadId::current());
+ trace!("{:?} Releasing mutex.", ThreadId::current());
self.mutex.unlock();
}
}
fn mk_guard(&self) -> ReentrantMutexGuard<T> {
let count = self.count.get().checked_add(1).expect("Overflowed lock count.");
- debug!("{:?} Incrementing count to {}.", ThreadId::current(), count);
+ trace!("{:?} Incrementing count to {}.", ThreadId::current(), count);
self.count.set(count);
ReentrantMutexGuard { mutex: self }
}