首页>
外国专利>
Method and apparatus for converting a synchronized method into a non-synchronized method
Method and apparatus for converting a synchronized method into a non-synchronized method
展开▼
机译:用于将同步方法转换成非同步方法的方法和装置
展开▼
页面导航
摘要
著录项
相似文献
摘要
One embodiment of the present invention provides a system that facilitates converting a synchronized method into a non-synchronized method. During operation, the system receives a code module that includes a synchronized method. This synchronized method automatically performs a lock operation before executing its method body and automatically performs an unlock operation after executing its method body, whereby at most one thread at a time can execute the method body. Next, the system changes the synchronized method into a non-synchronized method that does not automatically perform lock and unlock operations. The system also inserts an explicit lock instruction at the beginning of the method body, and inserts an explicit unlock instruction at the end of the method body.
展开▼