jstests/concurrency/fsm_workloads/random_DDL_CRUD_operations.js
/**
     * Used for mutual exclusion. Uses a collection to ensure atomicity on the read and update
     * operation.
     */
Used for mutual exclusion. Uses a collection to ensure atomicity on the read and update
operation.
Used for mutual exclusion . Uses a collection to ensure atomicity on the read and update operation .
function mutexLock(db, tid, collName) {
        jsTestLog('Trying to acquire mutexLock for resource tid:' + tid +
                  ' collection:' + collName);
        assertAlways.soon(() => {
            let doc =
                db[data.CRUDMutex].findAndModify({query: {tid: tid}, update: {$set: {mutex: 1}}});
            return doc.mutex === 0;
        });
        jsTestLog('Acquired mutexLock for tid:' + tid + ' collection:' + collName);
    }
function mutexLock ( db , tid , collName ) { jsTestLog ( 'Trying to acquire mutexLock for resource tid:' + tid + ' collection:' + collName ) ; assertAlways . soon ( ( ) => { let doc = db [ data . CRUDMutex ] . findAndModify ( { query : { tid : tid } , update : { $set : { mutex : 1 } } } ) ; return doc . mutex === 0 ; } ) ; jsTestLog ( 'Acquired mutexLock for tid:' + tid + ' collection:' + collName ) ; }
Used for mutual exclusion.
Used for mutual exclusion .