pragmagic / vscode-nim

An extension for VS Code which provides support for the Nim language.
Other
237 stars 37 forks source link

Strange behavior of stdin with imported threadpool #86

Open R3D9477 opened 6 years ago

R3D9477 commented 6 years ago

Hi. I have a strange behavior of stdin with imported threadpool: main.nim

import threadpool
import strutils

var cmd = 0x00
while (cmd != 0x01):
  stdout.write("> ")
  var buff = stdin.readLine()
  if buff.len < 1: continue
  echo ">>>>>> '" & buff & "'"
  cmd = parseInt(buff)

result output:

Running executable
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff72e2700 (LWP 15293)]
[New Thread 0x7ffff70e3700 (LWP 15294)]
[New Thread 0x7ffff6e64700 (LWP 15295)]
[New Thread 0x7ffff6be5700 (LWP 15296)]
> >>>>>> '9-thread-info'
Thread 1 "main" hit Breakpoint 1, NimMainModule () at Prog-Experiments/Nim/misc/stdin_bug/src/main.nim:10
10    cmd = parseInt(buff)

1

Where from XXX-thread-info? (this trouble hides if remove or comment import threadpool)

This issue just moved from here: https://github.com/nim-lang/Nim/issues/7396#issuecomment-375881688