The synchronized keyword can be applied to a method or a block of code. The primary purpose of the synchronized keyword is to lock a shared resource to a single thread. The technical term for locking a resource is called an intrinsic lock or monitor lock. In this tutorial I will demonstrate populating an ArrayList from multiple threads using the non-thread-safe add() method. This tutorial will demonstrate applying the synchronized keyword to a static method and a code block to make our method thread safe.
Nesta página do site você pode assistir ao vídeo on-line Learn Java Programming - Synchronized Static Method Tutorial duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Daniel Ross 23 Dezembro 2015, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 3,879 vezes e gostou 32 espectadores. Boa visualização!