Support thread-local variables declared inside procs; fixes #7565

This commit is contained in:
Zahary Karadjov 2018-04-29 13:50:21 +03:00 • committed by Andreas Rumpf
commit ae5c946a32
4 changed files with 85 additions and 3 deletions

View file

@ -7798,8 +7798,9 @@ Future directions:
Threadvar pragma
----------------
A global variable can be marked with the ``threadvar`` pragma; it is
a `thread-local`:idx: variable then:
A variable can be marked with the ``threadvar`` pragma, which makes it a
`thread-local`:idx: variable; Additionally, this implies all the effects
of the ``global`` pragma.
.. code-block:: nim
var checkpoints* {.threadvar.}: seq[string]