unix: remove unnecessary pthread_join ESRCH check

ESRCH means the thread never got started but we guard against that now.
This commit is contained in:
Ben Noordhuis 2012-10-10 01:09:45 +02:00
parent acea3028c5
commit 4affbe70b6

View File

@ -98,18 +98,17 @@ static void init_once(void) {
__attribute__((destructor))
static void cleanup(void) {
unsigned int i;
int err;
if (initialized == 0)
return;
post(&exit_message);
for (i = 0; i < ARRAY_SIZE(threads); i++) {
err = pthread_join(threads[i], NULL);
assert(err == 0 || err == ESRCH);
(void) err; /* Silence compiler warning in release builds. */
}
for (i = 0; i < ARRAY_SIZE(threads); i++)
if (pthread_join(threads[i], NULL))
abort();
initialized = 0;
}