summaryrefslogtreecommitdiff
path: root/lang/csharp/src/Lock.cs
blob: b81a85451781c95adbc15bf719abf0652f05d00b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*-
 * See the file LICENSE for redistribution information.
 *
 * Copyright (c) 2009, 2015 Oracle and/or its affiliates.  All rights reserved.
 *
 */
using System;
using System.Collections.Generic;
using System.Text;
using BerkeleyDB.Internal;

namespace BerkeleyDB {
    internal class Lock {
        private DB_LOCK dblock;

        internal uint Generation { get { return dblock.gen; } }
        internal uint Index { get { return dblock.ndx; } }
        internal uint Offset { get { return dblock.off; } }
        internal LockMode Mode { get { return LockMode.GetLockMode(dblock.mode); } }

        internal Lock(DB_LOCK lck) {
            dblock = lck;

        }

        static internal DB_LOCK GetDB_LOCK(Lock lck) {
            return lck == null ? null : lck.dblock;
        }
    }
}