## DnfLock

DnfLock

## Functions

DnfLock * | dnf_lock_new ()
guint | dnf_lock_get_state ()
void | dnf_lock_set_lock_dir ()
guint | dnf_lock_take ()
gboolean | dnf_lock_release ()
void | dnf_lock_release_noerror ()
const gchar * | dnf_lock_type_to_string ()

## Types and Values

#define | DNF_TYPE_LOCK
struct | DnfLockClass
enum | DnfLockType
enum | DnfLockMode
| DnfLock

## Description

## Functions

### dnf_lock_new ()

    DnfLock *
    dnf_lock_new (void);

### dnf_lock_get_state ()

    guint
    dnf_lock_get_state (DnfLock *lock);

### dnf_lock_set_lock_dir ()

    void
    dnf_lock_set_lock_dir (DnfLock *lock,
                           const gchar *lock_dir);

### dnf_lock_take ()

    guint
    dnf_lock_take (DnfLock *lock,
                   DnfLockType type,
                   DnfLockMode mode,
                   GError **error);

### dnf_lock_release ()

    gboolean
    dnf_lock_release (DnfLock *lock,
                      guint id,
                      GError **error);

### dnf_lock_release_noerror ()

    void
    dnf_lock_release_noerror (DnfLock *lock,
                              guint id);

### dnf_lock_type_to_string ()

    const gchar *
    dnf_lock_type_to_string (DnfLockType lock_type);

## Types and Values

### DNF_TYPE_LOCK

    #define DNF_TYPE_LOCK (dnf_lock_get_type ())

### struct DnfLockClass

    struct DnfLockClass {
            GObjectClass            parent_class;
            void                    (* state_changed)       (DnfLock        *lock,
                                                             guint           state_bitfield);
    };

### enum DnfLockType

The lock type.

#### Members

DNF_LOCK_TYPE_RPMDB | The rpmdb lock |
DNF_LOCK_TYPE_REPO | The repodir lock |
DNF_LOCK_TYPE_METADATA | The metadata lock |
DNF_LOCK_TYPE_CONFIG | The config lock |

### enum DnfLockMode

The lock mode.

#### Members

DNF_LOCK_MODE_THREAD | For all threads in this process |
DNF_LOCK_MODE_PROCESS | For all processes |

### DnfLock

    typedef struct _DnfLock DnfLock;