To ensure that locks are released, simply pair every lock method with an unlock method, which should be placed in a try-finally block. This is illustrated in Listing 4.
要保证锁得到释放,我们只需要在每一个lock之后对应执行一个unlock方法,而且它们应该置于try - finally复杂语句中。
Finally, if you do not get a satisfactory result, try not to get too angry.
最后,如果你没有得到一个满意的结果,尽量不要太生气。
应用推荐