mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-18 17:08:32 +00:00
Consistently use Channel instead of TChannel
This commit is contained in:
@@ -60,7 +60,7 @@ proc searchInstTypes*(key: PType): PType =
|
||||
if inst.id == key.id: return inst
|
||||
if inst.sons.len < key.sons.len:
|
||||
# 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
|
||||
return
|
||||
block matchType:
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
## Implementation of a `queue`:idx:. The underlying implementation uses a ``seq``.
|
||||
## Note: For inter thread communication use
|
||||
## a `TChannel <channels.html>`_ instead.
|
||||
## a `Channel <channels.html>`_ instead.
|
||||
|
||||
import math
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# bug #2257
|
||||
import threadpool
|
||||
|
||||
type StringChannel = TChannel[string]
|
||||
type StringChannel = Channel[string]
|
||||
var channels: array[1..3, StringChannel]
|
||||
|
||||
type
|
||||
|
||||
@@ -6,7 +6,7 @@ discard """
|
||||
# bug #2257
|
||||
import threadpool
|
||||
|
||||
type StringChannel = TChannel[string]
|
||||
type StringChannel = Channel[string]
|
||||
var channels: array[1..3, StringChannel]
|
||||
|
||||
type
|
||||
|
||||
@@ -9,7 +9,7 @@ tgc_unsafe2.nim(28, 5) Error: 'consumer' is not GC-safe as it calls 'track'
|
||||
|
||||
import threadpool
|
||||
|
||||
type StringChannel = TChannel[string]
|
||||
type StringChannel = Channel[string]
|
||||
var channels: array[1..3, StringChannel]
|
||||
|
||||
type
|
||||
|
||||
@@ -12,7 +12,7 @@ type
|
||||
|
||||
var
|
||||
producer, consumer: Thread[void]
|
||||
chan: TChannel[TMsg]
|
||||
chan: Channel[TMsg]
|
||||
printedLines = 0
|
||||
|
||||
proc consume() {.thread.} =
|
||||
|
||||
@@ -7,7 +7,7 @@ discard """
|
||||
from math import random
|
||||
from os import sleep
|
||||
|
||||
type PComm = ptr TChannel[int]
|
||||
type PComm = ptr Channel[int]
|
||||
|
||||
proc doAction(outC: PComm) {.thread.} =
|
||||
for i in 0.. <5:
|
||||
@@ -16,7 +16,7 @@ proc doAction(outC: PComm) {.thread.} =
|
||||
|
||||
var
|
||||
thr: Thread[PComm]
|
||||
chan: TChannel[int]
|
||||
chan: Channel[int]
|
||||
|
||||
open(chan)
|
||||
createThread[PComm](thr, doAction, addr(chan))
|
||||
|
||||
Reference in New Issue
Block a user