Skip to content
Snippets Groups Projects
Commit 3d435cc9 authored by Avi Kivity's avatar Avi Kivity
Browse files

mutex: add with_lock() function

This function allows executing a block of code under a lock, with a guarantee
that any exit from the block will release the lock.

Examples:

    with_lock(my_mutex, [&] { a += b; });

    return with_lock(my_spinlock, [&] {
        return my_list.size();
    });
parent f436fb66
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment