Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,9 @@ if !isdefined(Base, :Threads)
macro threads(expr)
return esc(expr)
end
export @threads
threadid() = 1
nthreads() = 1
export @threads, threadid, threadid
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is the bug. The second threadid should be nthreads

end
export Threads
end
Expand Down
6 changes: 6 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,12 @@ using Compat.Threads
@test true
end

# Issue #223
if VERSION < v"0.5"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fwiw this condition is always true even on master.

Copy link
Contributor Author

@ranjanan ranjanan Jun 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'll change this to VERSION < v"0.5.0"

@test threadid() == 1
@test nthreads() == 1
end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need import or qualified name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the bug is in a previous line.

@test @compat(Symbol("foo")) === :foo
@test @compat(Symbol("foo", "bar")) === :foobar
@test @compat(Symbol("a_", 2)) === :a_2
Expand Down