summary refs log tree commit diff stats
path: root/stubs/iothread-lock.c
blob: 54676598950f6c7a8d8bbfb2588eeae57e9fb5e2 (plain) (blame)
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
#include "qemu/osdep.h"
#include "qemu/main-loop.h"

static uint32_t bql_unlock_blocked;

bool bql_locked(void)
{
    return false;
}

void bql_lock_impl(const char *file, int line)
{
}

void bql_unlock(void)
{
    assert(!bql_unlock_blocked);
}

void bql_block_unlock(bool increase)
{
    uint32_t new_value;

    assert(bql_locked());

    /* check for overflow! */
    new_value = bql_unlock_blocked + increase - !increase;
    assert((new_value > bql_unlock_blocked) == increase);
    bql_unlock_blocked = new_value;
}