Skip to content

Commit

Permalink
Merge pull request #32 from RelationalAI/kp-prepend-threadid
Browse files Browse the repository at this point in the history
Prepend threadid to stacktraces
  • Loading branch information
kpamnany authored Aug 25, 2023
2 parents 3813ed2 + e015382 commit 25229a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions base/channels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,13 @@ Channel(func::Function, args...; kwargs...) = Channel{Any}(func, args...; kwargs
function Channel(func::Function; ctype=nothing, csize=nothing, taskref=nothing, spawn=nothing, threadpool=nothing)
# The spawn= keyword argument was added in Julia v1.3, and cannot be used with the
# deprecated keyword arguments `ctype=` or `csize=`.
if (ctype !== nothing || csize !== nothing) && spawn !== nothing
throw(ArgumentError("Cannot set `spawn=` in the deprecated constructor `Channel(f; ctype=Any, csize=0)`. Please use `Channel{T=Any}(f, size=0; taskref=nothing, spawn=false)` instead!"))
if (ctype !== nothing || csize !== nothing) && (spawn !== nothing || threadpool !== nothing)
throw(ArgumentError("Cannot set `spawn=` or `threadpool=` in the deprecated constructor `Channel(f; ctype=Any, csize=0)`. Please use `Channel{T=Any}(f, size=0; taskref=nothing, spawn=false, threadpool=nothing)` instead!"))
end
# Set the actual default values for the arguments.
ctype === nothing && (ctype = Any)
csize === nothing && (csize = 0)
spawn === nothing && (spawn = false)
threadpool !== nothing && (spawn = true)
return Channel{ctype}(func, csize; taskref=taskref, spawn=spawn, threadpool=threadpool)
end

Expand Down
1 change: 1 addition & 0 deletions src/stackwalk.c
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@ void jl_print_native_codeloc(int sig, uintptr_t ip) JL_NOTSAFEPOINT
if (sig != -1) {
jl_safe_printf("signal (%d) ", sig);
}
jl_safe_printf("thread (%d) ", jl_threadid());
jl_frame_t frame = frames[i];
if (!frame.func_name) {
jl_safe_printf("unknown function (ip: %p)\n", (void*)ip);
Expand Down

0 comments on commit 25229a9

Please sign in to comment.