diff options
author | aarzilli <alessandro.arzilli@gmail.com> | 2016-03-01 15:41:38 +0100 |
---|---|---|
committer | Přemysl Janouch <p@janouch.name> | 2018-09-08 16:49:24 +0200 |
commit | becaf43dcb3e9832c3eb951ff9908ed697868152 (patch) | |
tree | f2a45ac253c5ec8265efa78f1d4a2c993153fe18 /nexgb/xgbgen/context.go | |
parent | baff8c19067489ea26bbb804ef693e966202b511 (diff) | |
download | haven-becaf43dcb3e9832c3eb951ff9908ed697868152.tar.gz haven-becaf43dcb3e9832c3eb951ff9908ed697868152.tar.xz haven-becaf43dcb3e9832c3eb951ff9908ed697868152.zip |
Read/Write mutex for Extensions map
Diffstat (limited to 'nexgb/xgbgen/context.go')
-rw-r--r-- | nexgb/xgbgen/context.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/nexgb/xgbgen/context.go b/nexgb/xgbgen/context.go index f64f339..f18fd67 100644 --- a/nexgb/xgbgen/context.go +++ b/nexgb/xgbgen/context.go @@ -99,8 +99,9 @@ func (c *Context) Morph(xmlBytes []byte) { "on the server.\")", xname) c.Putln("}") c.Putln("") - c.Putln("xgb.ExtLock.Lock()") + c.Putln("c.ExtLock.Lock()") c.Putln("c.Extensions[\"%s\"] = reply.MajorOpcode", xname) + c.Putln("c.ExtLock.Unlock()") c.Putln("for evNum, fun := range xgb.NewExtEventFuncs[\"%s\"] {", xname) c.Putln("xgb.NewEventFuncs[int(reply.FirstEvent) + evNum] = fun") @@ -109,8 +110,6 @@ func (c *Context) Morph(xmlBytes []byte) { xname) c.Putln("xgb.NewErrorFuncs[int(reply.FirstError) + errNum] = fun") c.Putln("}") - c.Putln("xgb.ExtLock.Unlock()") - c.Putln("") c.Putln("return nil") c.Putln("}") c.Putln("") |