made more tests green; fixes #201

This commit is contained in:
Araq 2012-09-12 21:48:37 +02:00
commit a59abdf8e4
13 changed files with 43 additions and 30 deletions

View file

@ -180,12 +180,12 @@ proc rawRecv(q: PRawChannel, data: pointer, typ: PNimType) =
storeAux(data, addr(q.data[q.rd * typ.size]), typ, q, mLoad)
q.rd = (q.rd + 1) and q.mask
template lockChannel(q: expr, action: stmt) =
template lockChannel(q: expr, action: stmt) {.immediate.} =
acquireSys(q.lock)
action
releaseSys(q.lock)
template sendImpl(q: expr) =
template sendImpl(q: expr) {.immediate.} =
if q.mask == ChannelDeadMask:
raise newException(EDeadThread, "cannot send message; thread died")
acquireSys(q.lock)