File size: 360 Bytes
a21d9ae
 
 
 
 
8142460
a21d9ae
8142460
 
 
 
6ad51b0
8142460
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import threading

class Counter:
    def __init__(self):
        self.count = 0

    def increment(self):
        current = self.count
        self.count = current + 1
        return self.count

    def get_count(self):
        return self.count

    def decrement(self):
        current = self.count
        self.count = current - 1
        return self.count