Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

unix: don't abort if mutex init fails #1524

Open
wants to merge 2 commits into
base: v1.x
Choose a base branch
from

Conversation

LinuxJedi
Copy link

Instead of SIGABRT when mutex init fails gracefully return an error code
and cleanup.

Related to pull request #1522

Instead of SIGABRT when mutex init fails gracefully return an error code
and cleanup.
@saghul
Copy link
Contributor

saghul commented Oct 9, 2014

Please drop braces for single statement conditionals.

@LinuxJedi
Copy link
Author

sorry, every other project I work on requires them due to things like the Apple double-goto SSL bug :)

Has been fixed


if (pthread_mutexattr_destroy(&attr))
abort();
err = pthread_mutexattr_destroy(&attr);
Copy link
Contributor

Choose a reason for hiding this comment

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

return -... instead.

@saghul
Copy link
Contributor

saghul commented Oct 13, 2014

The whole mutex / semaphore / condvar code is filled with aborts, I'd rather handle them all in a single go than have some functions abort and some return proper errors. As a result, some APIs might need to return int, since now they return void.

@LinuxJedi
Copy link
Author

hmm... so maybe I should abandon this until a 2.x version?

@saghul
Copy link
Contributor

saghul commented Oct 13, 2014

Just send the PR against master, work on it, and we'll merge it when ready. No rush :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants