Changeset 826 for trunk/server/lib/tdb/common/lock.c
- Timestamp:
- Nov 12, 2013, 7:56:26 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/lib/tdb/common/lock.c
r825 r826 123 123 APIRET rc; 124 124 ULONG fAccess = 0; // default exclusiv 125 FILELOCK lockArea = {0}, unlockArea = {0} , unlockArea1 = {0};125 FILELOCK lockArea = {0}, unlockArea = {0}; 126 126 127 127 TDB_LOG((tdb, TDB_DEBUG_TRACE, "fcntl_lock in pid %d, fd %d, lck_type %s, rw_type %s, offset %d, len %d\n", … … 140 140 case F_UNLCK: 141 141 unlockArea.lOffset = off; 142 unlockArea.lRange = len ? len : tdb->header.hash_size *4; //was LONG_MAX 143 unlockArea1.lOffset = off; 144 unlockArea1.lRange = len ? len : LONG_MAX; 142 unlockArea.lRange = len ? len : LONG_MAX 145 143 break; 146 144 case F_RDLCK: … … 157 155 } 158 156 159 // why DosSetFileLocks() in the F_UNLCK case with len == 0, fails is really a question160 // to overcome that i do 2 unlock with 2 different length (nasty workaround imho)161 157 rc = DosSetFileLocks(tdb->fd, &unlockArea, &lockArea, SEM_IMMEDIATE_RETURN, fAccess); 162 if (rc != NO_ERROR && rw == F_UNLCK && len == 0)163 rc = DosSetFileLocks(tdb->fd, &unlockArea1, &lockArea, SEM_IMMEDIATE_RETURN, fAccess);164 158 165 159 if (rc != NO_ERROR && waitflag) { … … 167 161 do { 168 162 rc = DosSetFileLocks(tdb->fd, &unlockArea, &lockArea, 100, fAccess); 169 if (rc != NO_ERROR && rw == F_UNLCK && len == 0)170 rc = DosSetFileLocks(tdb->fd, &unlockArea1, &lockArea, 100, fAccess);171 163 count--; 172 164 } while( count>0 && rc !=NO_ERROR);
Note:
See TracChangeset
for help on using the changeset viewer.