Ignore:
Timestamp:
Mar 18, 2014, 4:51:05 PM (11 years ago)
Author:
Silvan Scherrer
Message:

Samba 3.6: remove mutex sem and do it with a filelock

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/lib/tdb/common/io.c

    r848 r857  
    9898        // is a write lock: do not wait for lock.
    9999        // so this is what we try here:
    100         // 1. add a write lock and see if it works
     100        // 1. add a write lock and see it it works
    101101        // 2. if the write lock wasn't set, we try to unlock the segment
    102         //    first and add the write lock afterwards
     102        //    first and add the write lock afterwards
     103        // 3. we remove the write lock further down
     104        // 4. we might add the removed lock from step #2 again
    103105        int upgradeLockRC = 0;
     106        int unlockRC = -1;
    104107        upgradeLockRC = tdb_brlock(tdb, F_WRLCK, off, len, TDB_LOCK_NOWAIT);
    105108        if (upgradeLockRC != 0) {
    106                 tdb_brunlock(tdb, F_RDLCK, off, len);
     109                unlockRC = tdb_brunlock(tdb, F_RDLCK, off, len);
    107110                upgradeLockRC = tdb_brlock(tdb, F_WRLCK, off, len, TDB_LOCK_NOWAIT);
    108111        }
Note: See TracChangeset for help on using the changeset viewer.