void coroutine_fn qemu_co_mutex_lock(CoMutex *mutex)

{

    Coroutine *self = qemu_coroutine_self();



    trace_qemu_co_mutex_lock_entry(mutex, self);



    while (mutex->locked) {

        qemu_co_queue_wait(&mutex->queue);

    }



    mutex->locked = true;




    trace_qemu_co_mutex_lock_return(mutex, self);

}