Changeset 857 for trunk/server/lib/tdb/common/io.c
- Timestamp:
- Mar 18, 2014, 4:51:05 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/lib/tdb/common/io.c
r848 r857 98 98 // is a write lock: do not wait for lock. 99 99 // so this is what we try here: 100 // 1. add a write lock and see i fit works100 // 1. add a write lock and see it it works 101 101 // 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 103 105 int upgradeLockRC = 0; 106 int unlockRC = -1; 104 107 upgradeLockRC = tdb_brlock(tdb, F_WRLCK, off, len, TDB_LOCK_NOWAIT); 105 108 if (upgradeLockRC != 0) { 106 tdb_brunlock(tdb, F_RDLCK, off, len);109 unlockRC = tdb_brunlock(tdb, F_RDLCK, off, len); 107 110 upgradeLockRC = tdb_brlock(tdb, F_WRLCK, off, len, TDB_LOCK_NOWAIT); 108 111 }
Note:
See TracChangeset
for help on using the changeset viewer.