rspec/rules/S2551/description.adoc
Arseniy Zaostrovnykh 7ca29f686f Force linebreaks
2021-02-02 15:02:10 +01:00

13 lines
456 B
Plaintext

Shared resources should not be used for locking as it increases the chance of deadlocks. Any other thread could acquire (or attempt to acquire) the same lock for another unrelated purpose.
Instead, a dedicated ``++object++`` instance should be used for each shared resource, to avoid deadlocks or lock contention.
The following objects are considered as shared resources:
* ``++this++``
* a ``++Type++`` object
* a string literal
* a string instance