Consistently use Channel instead of TChannel

This commit is contained in:
def 2016-02-25 04:04:45 +01:00
commit 7177e0058b
7 changed files with 8 additions and 8 deletions

View file

@ -60,7 +60,7 @@ proc searchInstTypes*(key: PType): PType =
if inst.id == key.id: return inst if inst.id == key.id: return inst
if inst.sons.len < key.sons.len: if inst.sons.len < key.sons.len:
# XXX: This happens for prematurely cached # XXX: This happens for prematurely cached
# types such as TChannel[empty]. Why? # types such as Channel[empty]. Why?
# See the notes for PActor in handleGenericInvocation # See the notes for PActor in handleGenericInvocation
return return
block matchType: block matchType:

View file

@ -9,7 +9,7 @@
## Implementation of a `queue`:idx:. The underlying implementation uses a ``seq``. ## Implementation of a `queue`:idx:. The underlying implementation uses a ``seq``.
## Note: For inter thread communication use ## Note: For inter thread communication use
## a `TChannel <channels.html>`_ instead. ## a `Channel <channels.html>`_ instead.
import math import math

View file

@ -1,7 +1,7 @@
# bug #2257 # bug #2257
import threadpool import threadpool
type StringChannel = TChannel[string] type StringChannel = Channel[string]
var channels: array[1..3, StringChannel] var channels: array[1..3, StringChannel]
type type

View file

@ -6,7 +6,7 @@ discard """
# bug #2257 # bug #2257
import threadpool import threadpool
type StringChannel = TChannel[string] type StringChannel = Channel[string]
var channels: array[1..3, StringChannel] var channels: array[1..3, StringChannel]
type type

View file

@ -9,7 +9,7 @@ tgc_unsafe2.nim(28, 5) Error: 'consumer' is not GC-safe as it calls 'track'
import threadpool import threadpool
type StringChannel = TChannel[string] type StringChannel = Channel[string]
var channels: array[1..3, StringChannel] var channels: array[1..3, StringChannel]
type type

View file

@ -12,7 +12,7 @@ type
var var
producer, consumer: Thread[void] producer, consumer: Thread[void]
chan: TChannel[TMsg] chan: Channel[TMsg]
printedLines = 0 printedLines = 0
proc consume() {.thread.} = proc consume() {.thread.} =

View file

@ -7,7 +7,7 @@ discard """
from math import random from math import random
from os import sleep from os import sleep
type PComm = ptr TChannel[int] type PComm = ptr Channel[int]
proc doAction(outC: PComm) {.thread.} = proc doAction(outC: PComm) {.thread.} =
for i in 0.. <5: for i in 0.. <5:
@ -16,7 +16,7 @@ proc doAction(outC: PComm) {.thread.} =
var var
thr: Thread[PComm] thr: Thread[PComm]
chan: TChannel[int] chan: Channel[int]
open(chan) open(chan)
createThread[PComm](thr, doAction, addr(chan)) createThread[PComm](thr, doAction, addr(chan))