@@ -52,27 +52,27 @@ that represents the locked resource::
5252 $lock->release();
5353 }
5454
55- If the lock can not be acquired, the method returns ``false ``.You can safely
56- call the `` acquire() `` method repeatedly, even ifyou already acquired it .
55+ If the lock can not be acquired, the method returns ``false ``.The `` acquire() ``
56+ method can be safely called repeatedly, even ifthe lock is already acquired.
5757
5858..note ::
5959
6060 Unlike other implementations, the Lock Component distinguishes locks
61- instances even when they are created for the same resource. Ifyou want to
62- share a lock in several services, share the ``Lock `` instance returned by
63- the ``Factory::createLock `` method.
61+ instances even when they are created for the same resource. Ifa lock has
62+ to be used by several services,they should share thesame ``Lock `` instance
63+ returned by the ``Factory::createLock `` method.
6464
6565Blocking Locks
6666--------------
6767
6868By default, when a lock cannot be acquired, the ``acquire `` method returns
69- ``false `` immediately.In case you want to wait (indefinitely) until the lock
70- can be created, pass ``false `` as the argument of the ``acquire() `` method. This
69+ ``false `` immediately.To wait (indefinitely) until the lock
70+ can be created, pass ``true `` as the argument of the ``acquire() `` method. This
7171is called a **blocking lock ** because the execution of your application stops
7272until the lock is acquired.
7373
7474Some of the built-in ``Store `` classes support this feature. When they don't,
75- you candecorate them with the ``RetryTillSaveStore `` class::
75+ they canbe decorated with the ``RetryTillSaveStore `` class::
7676
7777 use Symfony\Component\Lock\Factory;
7878 use Symfony\Component\Lock\Store\RedisStore;
@@ -90,7 +90,7 @@ Expiring Locks
9090
9191Locks created remotely are difficult to manage because there is no way for the
9292remote ``Store `` to know if the locker process is still alive. Due to bugs,
93- fatal errors or segmentation faults,we can't guarantee that the ``release() ``
93+ fatal errors or segmentation faults,it cannot be guaranteed that ``release() ``
9494method will be called, which would cause the resource to be locked infinitely.
9595
9696The best solution in those cases is to create **expiring locks **, which are
@@ -100,12 +100,12 @@ the ``createLock()`` method. If needed, these locks can also be released early
100100with the ``release() `` method.
101101
102102The trickiest part when working with expiring locks is choosing the right TTL.
103- If it's too short, other processes could acquire the lock before finishingyour
104- work ; it it's too long and the process crashes before calling the ``release() ``
103+ If it's too short, other processes could acquire the lock before finishingthe
104+ job ; it it's too long and the process crashes before calling the ``release() ``
105105method, the resource will stay locked until the timeout::
106106
107107 // ...
108- // createa expiring lock that lasts 30 seconds
108+ // createan expiring lock that lasts 30 seconds
109109 $lock = $factory->createLock('charts-generation', 30);
110110
111111 $lock->acquire();
@@ -173,16 +173,16 @@ PHP process is terminated::
173173..caution ::
174174
175175 Beware that some file systems (such as some types of NFS) do not support
176- locking. In those cases, it's better to use alocal file or a remote store
177- based on Redis or Memcached.
176+ locking. In those cases, it's better to use adirectory on a local disk
177+ drive or a remote store based on Redis or Memcached.
178178
179179.. _lock-store-memcached :
180180
181181MemcachedStore
182182~~~~~~~~~~~~~~
183183
184- The MemcachedStore saves locks on a Memcached server,so first you must create
185- a Memcached connectionimplements the ``\Memcached `` class. This store does not
184+ The MemcachedStore saves locks on a Memcached server,it requires a Memcached
185+ connectionimplementing the ``\Memcached `` class. This store does not
186186support blocking, and expects a TTL to avoid stalled locks::
187187
188188 use Symfony\Component\Lock\Store\MemcachedStore;
@@ -201,8 +201,8 @@ support blocking, and expects a TTL to avoid stalled locks::
201201RedisStore
202202~~~~~~~~~~
203203
204- The RedisStore saves locks on a Redis server,so first you must create a Redis
205- connection implements the ``\Redis ``, ``\RedisArray ``, ``\RedisCluster `` or
204+ The RedisStore saves locks on a Redis server,it requires a Redis connection
205+ implementing the ``\Redis ``, ``\RedisArray ``, ``\RedisCluster `` or
206206``\Predis `` classes. This store does not support blocking, and expects a TTL to
207207avoid stalled locks::
208208
@@ -233,7 +233,7 @@ The CombinedStore is designed for High Availability applications because it
233233manages several stores in sync (for example, several Redis servers). When a lock
234234is being acquired, it forwards the call to all the managed stores, and it
235235collects their responses. If a simple majority of stores have acquired the lock,
236- then the lock is considered as acquired; otherwiseis not acquired::
236+ then the lock is considered as acquired; otherwiseas not acquired::
237237
238238 use Symfony\Component\Lock\Quorum\ConsensusStrategy;
239239 use Symfony\Component\Lock\Store\CombinedStore;
@@ -249,8 +249,9 @@ then the lock is considered as acquired; otherwise is not acquired::
249249
250250 $store = new CombinedStore($stores, new ConsensusStrategy());
251251
252- Instead of the simple majority strategy (``ConsensusStrategy ``) you can use the
253- ``UnanimousStrategy `` to require the lock to be acquired in all the stores.
252+ Instead of the simple majority strategy (``ConsensusStrategy ``) an
253+ ``UnanimousStrategy `` can be used to require the lock to be acquired in all
254+ he stores.
254255
255256.. _`locks` :https://en.wikipedia.org/wiki/Lock_(computer_science)
256257.. _Packagist :https://packagist.org/packages/symfony/lock