pub fn try_lock<'a>(&'a self, journal: &'a Journal<A>) -> TryLockResult<MutexGuard<'a, T, A>> {
        if self.raw_trylock(journal) {
            unsafe { Ok(MutexGuard::new(self, journal)) }
        } else {
            Err(TryLockError::WouldBlock)
        }
    }
/// Attempts to acquire this lock.
/// 
/// If the lock could not be acquired at this time, then [`Err`] is returned.
/// Otherwise, an RAII guard is returned. The lock will be unlocked when the
/// owner transaction ends.
///
/// This function does not block.
///
/// # Errors
///
/// If another user of this mutex holds a guard, then this call will return
/// failure if the mutex would otherwise be acquired.
///
/// # Examples
///
/// ```
/// use corundum::default::*;
/// use std::thread;
/// 
/// type P = Allocator;
/// 
/// let obj = P::open::<Parc<PMutex<i32>>>("foo.pool", O_CF).unwrap();
///
/// let a = Parc::demote(&obj);
/// thread::spawn(move || {
///     transaction(|j| {
///         if let Some(obj) = a.promote(j) {
///             let mut lock = obj.try_lock(j);
///             if let Ok(ref mut mutex) = lock {
///                 **mutex = 10;
///             } else {
///                 println!("try_lock failed");
///             }
///         }
///     }).unwrap();
/// }).join().expect("thread::spawn failed");
/// 
/// transaction(|j| {
///     assert_eq!(*obj.lock(j), 10);
/// }).unwrap();
/// ```
/// 
/// [`PMutex`]: ../default/type.PMutex.html
Attempts to acquire this lock.
If the lock could not be acquired at this time, then [`Err`] is returned.
Otherwise, an RAII guard is returned. The lock will be unlocked when the
owner transaction ends.

This function does not block.
Attempts to acquire this lock . If the lock could not be acquired at this time then [ ` Err ` ] is returned . Otherwise an RAII guard is returned . The lock will be unlocked when the owner transaction ends . This function does not block .
pub fn try_lock<'a>(&'a self, journal: &'a Journal<A>) -> TryLockResult<MutexGuard<'a, T, A>> {
        if self.raw_trylock(journal) {
            unsafe { Ok(MutexGuard::new(self, journal)) }
        } else {
            Err(TryLockError::WouldBlock)
        }
    }
pub fn try_lock < ' a > ( & ' a self , journal : & ' a Journal < A > ) -> TryLockResult < MutexGuard < ' a , T , A > > { if self . raw_trylock ( journal ) { unsafe { Ok ( MutexGuard :: new ( self , journal ) ) } } else { Err ( TryLockError :: WouldBlock ) } }
Attempts to acquire this lock.
Attempts to acquire this lock .
&'a self
journal
&'a Journal<A>
errors
If another user of this mutex holds a guard, then this call will return
failure if the mutex would otherwise be acquired.
If another user of this mutex holds a guard then this call will return failure if the mutex would otherwise be acquired .
examples
```
use corundum::default::*;
use std::thread.

type P = Allocator.



let a = Parc::demote(&obj);
thread::spawn(move || {
transaction(|j| {
if let Some(obj) = a.promote(j) {
let mut lock = obj.try_lock(j);
if let Ok(ref mut mutex) = lock {
mutex = 10;
} else {
println!("try_lock failed");
}
}
}).unwrap();
}).join().expect("thread::spawn failed").



[`PMutex`]: ../default/type.PMutex.html
` ` ` use corundum :: default :: * ; use std :: thread . type P = Allocator . let a = Parc :: demote ( &obj ) ; thread :: spawn ( move || { transaction ( |j| { if let Some ( obj ) = a . promote ( j ) { let mut lock = obj . try_lock ( j ) ; if let Ok ( ref mut mutex ) = lock { mutex = 10 ; } else { println! ( " try_lock failed " ) ; } } } ) . unwrap () ; } ) . join () . expect ( " thread :: spawn failed " ) . [ ` PMutex ` ] : .. / default / type . PMutex . html