aboutsummaryrefslogtreecommitdiff
path: root/internal/line
diff options
context:
space:
mode:
Diffstat (limited to 'internal/line')
-rw-r--r--internal/line/line.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/internal/line/line.go b/internal/line/line.go
new file mode 100644
index 0000000..02dbbcc
--- /dev/null
+++ b/internal/line/line.go
@@ -0,0 +1,22 @@
+package line
+
+import "sync"
+
+type Line struct {
+ sync.Mutex
+ num int64
+}
+
+func (l *Line) Inc() {
+ l.Lock()
+ defer l.Unlock()
+
+ l.num++
+}
+
+func (l *Line) Num() int64 {
+ l.Lock()
+ defer l.Unlock()
+
+ return l.num
+}