// 
// Decompiled by Procyon v0.6.0
// 

package io.sentry.util;

import org.jetbrains.annotations.NotNull;
import io.sentry.ISentryLifecycleToken;
import java.util.concurrent.locks.ReentrantLock;

public final class AutoClosableReentrantLock extends ReentrantLock
{
    private static final long serialVersionUID = -3283069816958445549L;
    
    public ISentryLifecycleToken acquire() {
        this.lock();
        return new AutoClosableReentrantLockLifecycleToken(this);
    }
    
    static final class AutoClosableReentrantLockLifecycleToken implements ISentryLifecycleToken
    {
        @NotNull
        private final ReentrantLock lock;
        
        AutoClosableReentrantLockLifecycleToken(@NotNull final ReentrantLock lock) {
            this.lock = lock;
        }
        
        @Override
        public void close() {
            this.lock.unlock();
        }
    }
}
