summaryrefslogtreecommitdiff
path: root/newsort.go
diff options
context:
space:
mode:
Diffstat (limited to 'newsort.go')
-rw-r--r--newsort.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/newsort.go b/newsort.go
index 5b6084b..aa6a8c2 100644
--- a/newsort.go
+++ b/newsort.go
@@ -3,6 +3,8 @@ package main
import (
"os"
"strings"
+
+ "go.wit.com/log"
)
func (pb *Files) makeNewSortfile(pf *File) {
@@ -10,12 +12,15 @@ func (pb *Files) makeNewSortfile(pf *File) {
header(f, pf)
- if sortmap["lock"] == "all" {
- // if the lock is set to 'all' this means the mutex was put in the protoc-gen-go struct
- } else {
- syncLock(f, sortmap)
+ for _, msg := range pf.MsgNames {
+ if msg.DoMutex {
+ pf.syncLock(f, msg.Lockname)
+ pf.iterTop(f, msg.Name)
+ } else {
+ log.Info("Skipping syncLock() for", msg.Name, "DoMutex = false")
+ }
}
- iterTop(f, sortmap)
+
iterNext(f, sortmap)
iterAppend(f, sortmap) // Append() enforce no unique keys
iterSortAll(f, sortmap)