Skip to content

Commit

Permalink
feat: Catch up 4.13.1 minor fixes and performance improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Jim.Idle <jimi@idle.ws>
  • Loading branch information
jimidle authored and parrt committed May 15, 2024
1 parent c0b7dd0 commit 41b9360
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
38 changes: 38 additions & 0 deletions runtime/Go/antlr/v4/mutex.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// +build !nomutex

package antlr

import "sync"

type Mutex struct {
mu sync.Mutex
}

func (m *Mutex) Lock() {
m.mu.Lock()
}

func (m *Mutex) Unlock() {
m.mu.Unlock()
}


type RWMutex struct {
mu sync.RWMutex
}

func (m *RWMutex) Lock() {
m.mu.Lock()
}

func (m *RWMutex) Unlock() {
m.mu.Unlock()
}

func (m *RWMutex) RLock() {
m.mu.RLock()
}

func (m *RWMutex) RUnlock() {
m.mu.RUnlock()
}
31 changes: 31 additions & 0 deletions runtime/Go/antlr/v4/mutex_nomutex.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// +build nomutex

package antlr

type Mutex struct{}

func (m *Mutex) Lock() {
// No-op
}

func (m *Mutex) Unlock() {
// No-op
}

type RWMutex struct{}

func (m *RWMutex) Lock() {
// No-op
}

func (m *RWMutex) Unlock() {
// No-op
}

func (m *RWMutex) RLock() {
// No-op
}

func (m *RWMutex) RUnlock() {
// No-op
}

0 comments on commit 41b9360

Please sign in to comment.