channel send() condition variable lock ordering (#20879)

This commit is contained in:
Ico Doornekamp 2022-11-21 13:11:28 +01:00 • committed by GitHub
commit 79b25a911b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -363,8 +363,8 @@ proc sendImpl(q: PRawChannel, typ: PNimType, msg: pointer, noBlock: bool): bool
rawSend(q, msg, typ) rawSend(q, msg, typ)
q.elemType = typ q.elemType = typ
releaseSys(q.lock)
signalSysCond(q.cond) signalSysCond(q.cond)
releaseSys(q.lock)
result = true result = true
proc send*[TMsg](c: var Channel[TMsg], msg: sink TMsg) {.inline.} = proc send*[TMsg](c: var Channel[TMsg], msg: sink TMsg) {.inline.} =