Lock thread by the synchronized block
The Alinous-Core supports synchronized block to lock the thread. There are 2 type of usage.
If the synchronized block used without name, threads are synchronized at the block. A single thread can execute the code inside the block.
The scope of locking in only in this block. If synchronized block is used at other line, or other script, it has nothing todo with them.
You can name the synchronized block.A single thread can execute the code inside the named block which has same name.
The lock is managed by the name. The name is String type variable.
Named synchronized block's locking scope is global. If same name is used at other script or other line, they are synchronized.
The name of the synchronized block is just a string. You can specify it by using variable or static string.