<p dir="auto">Could we add <code class="notranslate">Bool</code> to the list of types supported by <code class="notranslate">Threads.Atomic</code>? Currently atomics only supports int types and float types, but I don't see any reason why it couldn't also support booleans! :)</p>
<p dir="auto">For now as a workaround, you have to use an <code class="notranslate">x = Threads.Atomic{UInt8}</code> and always check <code class="notranslate">if x != 0</code> instead of just <code class="notranslate">if x</code>.</p>
<p dir="auto">I couldn't find either a github issue or discourse thread about this already, sorry if this is a duplicate. Thanks! :)</p>
<p dir="auto">The following syntax doesn't work for macros (but does for functions):</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; macro foo(a, b::Bool=true)
          a, b
       end
ERROR: syntax: &quot;(kw (:: b Bool) #t)&quot; is not a valid function argument name

julia&gt; function foo(a, b::Bool=true)  #works for functions
          a, b
       end
foo (generic function with 2 methods)

julia&gt; foo(1)
(1,true)"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-k">macro</span> <span class="pl-en">foo</span>(a, b<span class="pl-k">::</span><span class="pl-c1">Bool</span><span class="pl-k">=</span><span class="pl-c1">true</span>)
          a, b
       <span class="pl-k">end</span>
ERROR<span class="pl-k">:</span> syntax<span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">"</span>(kw (:: b Bool) #t)<span class="pl-pds">"</span></span> is not a valid <span class="pl-k">function</span> argument name

julia<span class="pl-k">&gt;</span> <span class="pl-k">function</span> <span class="pl-en">foo</span>(a, b<span class="pl-k">::</span><span class="pl-c1">Bool</span><span class="pl-k">=</span><span class="pl-c1">true</span>)  <span class="pl-c"><span class="pl-c">#</span>works for functions</span>
          a, b
       <span class="pl-k">end</span>
foo (generic <span class="pl-k">function</span> with <span class="pl-c1">2</span> methods)

julia<span class="pl-k">&gt;</span> <span class="pl-c1">foo</span>(<span class="pl-c1">1</span>)
(<span class="pl-c1">1</span>,<span class="pl-c1">true</span>)</pre></div>