-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reworked indexes, merging and deduplication of dual-loaded distinguis…
…hedName objects - also CNF and DEL objects are not loaded default now
- Loading branch information
1 parent
3dd0f7b
commit f1fa2f6
Showing
14 changed files
with
738 additions
and
451 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package engine | ||
|
||
import "sync" | ||
|
||
type FlexMutex struct { | ||
m sync.RWMutex | ||
enabled uint64 | ||
} | ||
|
||
func (fm *FlexMutex) Lock() { | ||
if fm.enabled != 0 { | ||
fm.m.Lock() | ||
} | ||
} | ||
|
||
func (fm *FlexMutex) Unlock() { | ||
if fm.enabled != 0 { | ||
fm.m.Unlock() | ||
} | ||
} | ||
|
||
func (fm *FlexMutex) RLock() { | ||
if fm.enabled != 0 { | ||
fm.m.RLock() | ||
} | ||
} | ||
|
||
func (fm *FlexMutex) RUnlock() { | ||
if fm.enabled != 0 { | ||
fm.m.RUnlock() | ||
} | ||
} | ||
|
||
func (fm *FlexMutex) Enable() { | ||
fm.enabled++ | ||
} | ||
|
||
func (fm *FlexMutex) Disable() { | ||
if fm.enabled == 0 { | ||
panic("FlexMutex is already disabled") | ||
} | ||
fm.enabled-- | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.