lib/ovsdb-idl.c
/* Attempts to commit the current transaction, if one is open, and sets up the
 * poll loop to wake up when some more work might be needed.
 *
 * If a transaction was open, in this or a previous iteration of the main loop,
 * and had not before finished committing (successfully or unsuccessfully), the
 * return value is one of:
 *
 *  1: The transaction committed successfully (or it did not change anything in
 *     the database).
 *  0: The transaction failed.
 * -1: The commit is still in progress.
 *
 * Thus, the return value is -1 if the transaction is in progress and otherwise
 * true for success, false for failure.
 *
 * (In the corner case where the IDL sends a transaction to the database and
 * the database commits it, and the connection between the IDL and the database
 * drops before the IDL receives the message confirming the commit, this
 * function can return 0 even though the transaction succeeded.)
 */
Attempts to commit the current transaction, if one is open, and sets up the
poll loop to wake up when some more work might be needed.

If a transaction was open, in this or a previous iteration of the main loop,
and had not before finished committing (successfully or unsuccessfully), the
return value is one of.

The transaction committed successfully (or it did not change anything in
the database).
0: The transaction failed.
-1: The commit is still in progress.

Thus, the return value is -1 if the transaction is in progress and otherwise
true for success, false for failure.

(In the corner case where the IDL sends a transaction to the database and
the database commits it, and the connection between the IDL and the database
drops before the IDL receives the message confirming the commit, this
function can return 0 even though the transaction succeeded.)
Attempts to commit the current transaction if one is open and sets up the poll loop to wake up when some more work might be needed . If a transaction was open in this or a previous iteration of the main loop and had not before finished committing ( successfully or unsuccessfully ) the return value is one of . The transaction committed successfully ( or it did not change anything in the database ) . 0 : The transaction failed . - 1 : The commit is still in progress . Thus the return value is - 1 if the transaction is in progress and otherwise true for success false for failure . ( In the corner case where the IDL sends a transaction to the database and the database commits it and the connection between the IDL and the database drops before the IDL receives the message confirming the commit this function can return 0 even though the transaction succeeded . )
int
ovsdb_idl_loop_commit_and_wait(struct ovsdb_idl_loop *loop)
{
    if (loop->open_txn) {
        loop->committing_txn = loop->open_txn;
        loop->open_txn = NULL;
        loop->precommit_seqno = ovsdb_idl_get_seqno(loop->idl);
    }
    bool may_need_wakeup = false;
    int retval = ovsdb_idl_try_commit_loop_txn(loop, &may_need_wakeup);
    if (may_need_wakeup) {
        poll_immediate_wake();
    }
    ovsdb_idl_wait(loop->idl);
    return retval;
}
int ovsdb_idl_loop_commit_and_wait ( struct ovsdb_idl_loop * loop ) { if ( loop -> open_txn ) { loop -> committing_txn = loop -> open_txn ; loop -> open_txn = NULL ; loop -> precommit_seqno = ovsdb_idl_get_seqno ( loop -> idl ) ; } bool may_need_wakeup = false ; int retval = ovsdb_idl_try_commit_loop_txn ( loop , & may_need_wakeup ) ; if ( may_need_wakeup ) { poll_immediate_wake ( ) ; } ovsdb_idl_wait ( loop -> idl ) ; return retval ; }
Attempts to commit the current transaction, if one is open, and sets up the
 poll loop to wake up when some more work might be needed.
Attempts to commit the current transaction if one is open and sets up the poll loop to wake up when some more work might be needed .