Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ba7e97d

Browse files
bug #41990 [Lock] fix derivating semaphore from key (nicolas-grekas)
This PR was merged into the 4.4 branch. Discussion ---------- [Lock] fix derivating semaphore from key | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- d9dea8d [Lock] fix derivating semaphore from key
2 parents ad48f2c + d9dea8d commit ba7e97d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Lock/Store/SemaphoreStore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ private function lock(Key $key, bool $blocking)
6363
return;
6464
}
6565

66-
$keyId = crc32($key);
66+
$keyId = unpack('i', md5($key, true))[1];
6767
$resource = sem_get($keyId);
6868
$acquired = @sem_acquire($resource, !$blocking);
6969

0 commit comments

Comments
 (0)