Skip to content

Commit 41b9360

Browse files
jimidleparrt
authored andcommitted
feat: Catch up 4.13.1 minor fixes and performance improvements
Signed-off-by: Jim.Idle <[email protected]>
1 parent c0b7dd0 commit 41b9360

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

runtime/Go/antlr/v4/mutex.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// +build !nomutex
2+
3+
package antlr
4+
5+
import "sync"
6+
7+
type Mutex struct {
8+
mu sync.Mutex
9+
}
10+
11+
func (m *Mutex) Lock() {
12+
m.mu.Lock()
13+
}
14+
15+
func (m *Mutex) Unlock() {
16+
m.mu.Unlock()
17+
}
18+
19+
20+
type RWMutex struct {
21+
mu sync.RWMutex
22+
}
23+
24+
func (m *RWMutex) Lock() {
25+
m.mu.Lock()
26+
}
27+
28+
func (m *RWMutex) Unlock() {
29+
m.mu.Unlock()
30+
}
31+
32+
func (m *RWMutex) RLock() {
33+
m.mu.RLock()
34+
}
35+
36+
func (m *RWMutex) RUnlock() {
37+
m.mu.RUnlock()
38+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// +build nomutex
2+
3+
package antlr
4+
5+
type Mutex struct{}
6+
7+
func (m *Mutex) Lock() {
8+
// No-op
9+
}
10+
11+
func (m *Mutex) Unlock() {
12+
// No-op
13+
}
14+
15+
type RWMutex struct{}
16+
17+
func (m *RWMutex) Lock() {
18+
// No-op
19+
}
20+
21+
func (m *RWMutex) Unlock() {
22+
// No-op
23+
}
24+
25+
func (m *RWMutex) RLock() {
26+
// No-op
27+
}
28+
29+
func (m *RWMutex) RUnlock() {
30+
// No-op
31+
}

0 commit comments

Comments
 (0)