[Lock] fix derivating semaphore from key

This commit is contained in:
Nicolas Grekas 2021-07-05 13:39:04 +02:00
parent 44f08fa121
commit d9dea8d761

View File

@ -63,7 +63,7 @@ class SemaphoreStore implements StoreInterface, BlockingStoreInterface
return; return;
} }
$keyId = crc32($key); $keyId = unpack('i', md5($key, true))[1];
$resource = sem_get($keyId); $resource = sem_get($keyId);
$acquired = @sem_acquire($resource, !$blocking); $acquired = @sem_acquire($resource, !$blocking);