Race condition and concurrency safety of multithreaded object-oriented programming in Java

To ensure the reliability and quality, software systems should be safe. The software safety requires the data consistency in the software. In the multithreaded object-oriented programming, the coherency problem, also called a race condition, may destroy the data consistency. In order to overcome the coherency problem Java sets up the "synchronized" mechanism. However, improper use of the "synchronized" mechanism in Java will result in system deadlock, which also violates the requirement of software safety. We find that it is necessary to supplement a new function to the "synchronized" mechanism of Java. Another contribution in the paper is to propose a new approach for detecting system deadlock in Java multithreaded programs with the synchronized mechanism.