Skip to content

Commit 6eee62c

Browse files
committed
Reworded the lock usage introduction
1 parent c45b8ff commit 6eee62c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

components/lock.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,16 @@ Locks are used to guarantee exclusive access to some shared resource. In
2929
Symfony applications, you can use locks for example to ensure that a command is
3030
not executed more than once at the same time (on the same or different servers).
3131

32-
In order to manage the state of locks, a ``Store`` needs to be created first
33-
and then use the :class:`Symfony\\Component\\Lock\\Factory` class to actually
34-
create the lock for some resource::
32+
Locks are created using a :class:`Symfony\\Component\\Lock\\Factory` class,
33+
which in turn requires another class to manage the storage of locks::
3534

3635
use Symfony\Component\Lock\Factory;
3736
use Symfony\Component\Lock\Store\SemaphoreStore;
3837

3938
$store = new SemaphoreStore();
4039
$factory = new Factory($store);
4140

42-
The lock can be created by calling the :method:`Symfony\\Component\\Lock\\Factory::createLock`
41+
The lock is created by calling the :method:`Symfony\\Component\\Lock\\Factory::createLock`
4342
method. Its first argument is an arbitrary string that represents the locked
4443
resource. Then, a call to the :method:`Symfony\\Component\\Lock\\LockInterface::acquire`
4544
method will try to acquire the lock::

0 commit comments

Comments
 (0)