made more tests green; fixes #201

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

View File

@@ -157,7 +157,7 @@ proc card*[A](s: TOrderedSet[A]): int {.inline.} =
## alias for `len`.
result = s.counter
template forAllOrderedPairs(yieldStmt: stmt) {.dirty.} =
template forAllOrderedPairs(yieldStmt: stmt) {.dirty, immediate.} =
var h = s.first
while h >= 0:
var nxt = s.data[h].next

View File

@@ -202,7 +202,7 @@ proc len*[A, B](t: TOrderedTable[A, B]): int {.inline.} =
## returns the number of keys in `t`.
result = t.counter
template forAllOrderedPairs(yieldStmt: stmt) {.dirty.} =
template forAllOrderedPairs(yieldStmt: stmt) {.dirty, immediate.} =
var h = t.first
while h >= 0:
var nxt = t.data[h].next

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)