try mutex locks again

This commit is contained in:
Jeff Carr 2025-08-31 12:25:13 -05:00
parent f585edc192
commit 434f62a7e6
2 changed files with 5 additions and 4 deletions

View File

@ -50,7 +50,9 @@ func (all *Repos) NewGoRepo(fullpath string, gopath string) (*Repo, error) {
} }
// enforces GoPath is unique // enforces GoPath is unique
func (all *Repos) AppendByGoPath(newr *Repo) bool { // TODO: deprecate this (?)
// mutex's should finally work in the autogenpb protobuf code
func (all *Repos) AppendByGoPathOld(newr *Repo) bool {
// all.RLock() // all.RLock()
repoMu.RLock() repoMu.RLock()
@ -64,7 +66,6 @@ func (all *Repos) AppendByGoPath(newr *Repo) bool {
// all.RUnlock() // all.RUnlock()
repoMu.RUnlock() repoMu.RUnlock()
// all.Repos = append(all.Repos, newr)
all.Append(newr) all.Append(newr)
return true return true
} }

View File

@ -42,7 +42,7 @@ message GoInfo { // `autogenpb
bool gitIgnoresGoSum = 12; // does .gitignore ignore go.mod & go.sum? bool gitIgnoresGoSum = 12; // does .gitignore ignore go.mod & go.sum?
} }
message Repo { // `autogenpb:marshal` `autogenpb:nomutex` message Repo { // `autogenpb:marshal`
string namespace = 1; // `autogenpb:unique` `autogenpb:sort` // this repo is 'go.wit.com/lib/protobuf/gitpb' string namespace = 1; // `autogenpb:unique` `autogenpb:sort` // this repo is 'go.wit.com/lib/protobuf/gitpb'
string fullPath = 2; // `autogenpb:unique` `autogenpb:sort` // the OS path to the .git directory: '/home/devel/golang.org/x/tools' string fullPath = 2; // `autogenpb:unique` `autogenpb:sort` // the OS path to the .git directory: '/home/devel/golang.org/x/tools'
string masterBranchName = 3; // git 'main' or 'master' branch name string masterBranchName = 3; // git 'main' or 'master' branch name
@ -70,7 +70,7 @@ message Repo { // `autogenpb
GitConfig gitConfig = 25; // protobuf of the current .git/config GitConfig gitConfig = 25; // protobuf of the current .git/config
} }
message Repos { // `autogenpb:marshal` `autogenpb:sort` `autogenpb:nomutex` `autogenpb:gui` message Repos { // `autogenpb:marshal` `autogenpb:sort` `autogenpb:gui`
string uuid = 1; // `autogenpb:uuid:8daaeba1-fb1f-4762-ae6e-95a55d352673` string uuid = 1; // `autogenpb:uuid:8daaeba1-fb1f-4762-ae6e-95a55d352673`
string version = 2; // `autogenpb:version:v4` string version = 2; // `autogenpb:version:v4`
repeated Repo repos = 3; // `autogenpb:append` // generate AppendUnique() function for this repeated Repo repos = 3; // `autogenpb:append` // generate AppendUnique() function for this