Previous Topic Next topic Print topic


Synchronization - in COBOL and Java

Synchronization in Managed COBOL

*> Synchronize on an object's monitor, in this case
*> the current object
sync on self
   *> The code here is synchronized
end-sync

Synchronization in Java

// Synchronize on an object's monitor, in this case
// the current object
synchronized (this)
{
    // The code here is synchronised
}

Portions of these examples were produced by Dr. Frank McCown, Harding University Computer Science Dept, and are licensed under a Creative Commons License.

Previous Topic Next topic Print topic