forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Write heartbeat thread output to safe crash log (#155)
* Add `jl_inside_heartbeat_thread()` To allow `jl_safe_printf()` to determine whether it's being called from the heartbeat thread. * Write heartbeat thread output to the safe crash log In `jl_safe_printf()`, we're already writing to the safe crash log if we're in signal handler context (in addition to writing to `stderr`). Now we do the same if we're in the heartbeat thread. * Refactor JSON printing code Concurrent `write()` calls to the same file descriptor should be thread-safe, but can result in interleaving. Refactor the JSON printing code used from `jl_safe_printf()` to assemble the message into a buffer and use a single `write()` call.
- Loading branch information
Showing
2 changed files
with
69 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters