Changeset 878 for trunk/server/lib/tdb/common/io.c
- Timestamp:
- May 4, 2015, 7:21:36 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/lib/tdb/common/io.c
r866 r878 102 102 // first and add the write lock afterwards 103 103 // 3. we remove the write lock further down 104 // 4. we mightadd the removed lock from step #2 again104 // 4. we add the removed lock from step #2 again 105 105 int upgradeLockRC = 0; 106 106 int unlockRC = -1; 107 107 upgradeLockRC = tdb_brlock(tdb, F_WRLCK, off, len, TDB_LOCK_NOWAIT); 108 108 if (upgradeLockRC != 0) { 109 unlockRC = tdb_brunlock(tdb, F_RDLCK, off, len);109 unlockRC = tdb_brunlock(tdb, F_RDLCK, off, 1); 110 110 upgradeLockRC = tdb_brlock(tdb, F_WRLCK, off, len, TDB_LOCK_NOWAIT); 111 111 } … … 144 144 if (upgradeLockRC == 0) 145 145 tdb_brunlock( tdb, F_WRLCK, off, len); 146 if (unlockRC == 0) 147 tdb_brlock( tdb, F_RDLCK, off, 1, TDB_LOCK_WAIT); 146 148 #endif 147 149 return -1; … … 151 153 if (upgradeLockRC == 0) 152 154 tdb_brunlock( tdb, F_WRLCK, off, len); 155 if (unlockRC == 0) 156 tdb_brlock( tdb, F_RDLCK, off, 1, TDB_LOCK_WAIT); 153 157 #endif 154 158 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.