Skip to content

Fix assumption of pthread_t being a non-structure.#1167

Merged
daviesrob merged 1 commit intosamtools:developfrom
jkbonfield:pthread_pointer
Nov 6, 2020
Merged

Fix assumption of pthread_t being a non-structure.#1167
daviesrob merged 1 commit intosamtools:developfrom
jkbonfield:pthread_pointer

Conversation

@jkbonfield
Copy link
Copy Markdown
Contributor

Replaces #1154
See also #1153

It does this by the addition of a separate variable to do the boolean check on instead of fd->dispatcher itself. I deemed this easier to understand than overloading the interpretation of fd->h being set plus I'm unsure of the potential failure case in sam_hdr_fill_hrecs where fd->h has been set but we errored before creating the threads.

Also improves error recovering in case of pthread creation failure, avoiding a false pthread_join later. Thanks to John Marshall for identifying that issue.

Replaces samtools#1154
See also samtools#1153

It does this by the addition of a separate variable to do the boolean
check on instead of fd->dispatcher itself.  I deemed this easier to
understand than overloading the interpretation of fd->h being set plus
I'm unsure of the potential failure case in sam_hdr_fill_hrecs where
fd->h has been set but we errored before creating the threads.

Also improves error recovering in case of pthread creation failure,
avoiding a false pthread_join later.  Thanks to John Marshall and
Anders Kaplan for identifying that issue.
@daviesrob daviesrob merged commit 0ad12d7 into samtools:develop Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants