"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "include/qemu/coroutine.h" between
qemu-6.0.0-rc1.tar.xz and qemu-6.0.0-rc2.tar.xz

About: QEMU is a generic machine/processor emulator and virtualizer. Release candidate.

coroutine.h  (qemu-6.0.0-rc1.tar.xz):coroutine.h  (qemu-6.0.0-rc2.tar.xz)
skipping to change at line 239 skipping to change at line 239
*/ */
#define qemu_co_enter_next(queue, lock) \ #define qemu_co_enter_next(queue, lock) \
qemu_co_enter_next_impl(queue, QEMU_MAKE_LOCKABLE(lock)) qemu_co_enter_next_impl(queue, QEMU_MAKE_LOCKABLE(lock))
bool qemu_co_enter_next_impl(CoQueue *queue, QemuLockable *lock); bool qemu_co_enter_next_impl(CoQueue *queue, QemuLockable *lock);
/** /**
* Checks if the CoQueue is empty. * Checks if the CoQueue is empty.
*/ */
bool qemu_co_queue_empty(CoQueue *queue); bool qemu_co_queue_empty(CoQueue *queue);
typedef struct CoRwTicket CoRwTicket;
typedef struct CoRwlock { typedef struct CoRwlock {
int pending_writer;
int reader;
CoMutex mutex; CoMutex mutex;
CoQueue queue;
/* Number of readers, or -1 if owned for writing. */
int owners;
/* Waiting coroutines. */
QSIMPLEQ_HEAD(, CoRwTicket) tickets;
} CoRwlock; } CoRwlock;
/** /**
* Initialises a CoRwlock. This must be called before any other operation * Initialises a CoRwlock. This must be called before any other operation
* is used on the CoRwlock * is used on the CoRwlock
*/ */
void qemu_co_rwlock_init(CoRwlock *lock); void qemu_co_rwlock_init(CoRwlock *lock);
/** /**
* Read locks the CoRwlock. If the lock cannot be taken immediately because * Read locks the CoRwlock. If the lock cannot be taken immediately because
* of a parallel writer, control is transferred to the caller of the current * of a parallel writer, control is transferred to the caller of the current
* coroutine. * coroutine.
*/ */
void qemu_co_rwlock_rdlock(CoRwlock *lock); void qemu_co_rwlock_rdlock(CoRwlock *lock);
/** /**
* Write Locks the CoRwlock from a reader. This is a bit more efficient than * Write Locks the CoRwlock from a reader. This is a bit more efficient than
* @qemu_co_rwlock_unlock followed by a separate @qemu_co_rwlock_wrlock. * @qemu_co_rwlock_unlock followed by a separate @qemu_co_rwlock_wrlock.
* However, if the lock cannot be upgraded immediately, control is transferred * Note that if the lock cannot be upgraded immediately, control is transferred
* to the caller of the current coroutine. Also, @qemu_co_rwlock_upgrade * to the caller of the current coroutine; another writer might run while
* only overrides CoRwlock fairness if there are no concurrent readers, so * @qemu_co_rwlock_upgrade blocks.
* another writer might run while @qemu_co_rwlock_upgrade blocks.
*/ */
void qemu_co_rwlock_upgrade(CoRwlock *lock); void qemu_co_rwlock_upgrade(CoRwlock *lock);
/** /**
* Downgrades a write-side critical section to a reader. Downgrading with * Downgrades a write-side critical section to a reader. Downgrading with
* @qemu_co_rwlock_downgrade never blocks, unlike @qemu_co_rwlock_unlock * @qemu_co_rwlock_downgrade never blocks, unlike @qemu_co_rwlock_unlock
* followed by @qemu_co_rwlock_rdlock. This makes it more efficient, but * followed by @qemu_co_rwlock_rdlock. This makes it more efficient, but
* may also sometimes be necessary for correctness. * may also sometimes be necessary for correctness.
*/ */
void qemu_co_rwlock_downgrade(CoRwlock *lock); void qemu_co_rwlock_downgrade(CoRwlock *lock);
 End of changes. 4 change blocks. 
7 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)