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

Method deposit

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

Source from the content-addressed store, hash-verified

21 }
22
23 public int deposit(int value) {
24 int temp = balance;
25 try {
26 Thread.sleep(300);
27 temp = temp + value;
28 Thread.sleep(300);
29 balance = temp;
30 } catch (InterruptedException e) { }
31 return temp;
32 }
33
34 public int getBalance() {
35 return balance;

Callers 1

runMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected