MCPcopy Create free account
hub / github.com/careercup/ctci / withdraw

Method withdraw

java/Chapter 16/IntroductionLocks/NoLockATM.java:12–21  ·  view source on GitHub ↗
(int value)

Source from the content-addressed store, hash-verified

10 }
11
12 public int withdraw(int value) {
13 int temp = balance;
14 try {
15 Thread.sleep(300);
16 temp = temp - value;
17 Thread.sleep(300);
18 balance = temp;
19 } catch (InterruptedException e) { }
20 return temp;
21 }
22
23 public int deposit(int value) {
24 int temp = balance;

Callers 1

runMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected