首页> 外国专利> 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.
机译:本发明的一个实施例提供了一种有助于将同步方法转换成非同步方法的系统。在操作期间,系统会接收包含同步方法的代码模块。该同步方法在执行其方法主体之前自动执行锁定操作,并且在执行其方法主体之后自动执行解锁操作,从而一次最多只能有一个线程执行该方法主体。接下来,系统将同步方法更改为不自动执行锁定和解锁操作的非同步方法。系统还将在方法主体的开头插入一个显式锁定指令,并在方法主体的末尾插入一个显式解锁指令。

著录项

相似文献

  • 专利
  • 外文文献
  • 中文文献
获取专利

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号