#if defined __MACH__ && defined __APPLE__ /* OS X, iOS */
# include <sys/sysctl.h>
-# include <stdint.h>
+# include <inttypes.h>
#endif
#define IS_POWER_OF_2(x) ((x) > 0 && !((x) & ((x) - 1)))
PTHREAD_VERIFY(pthread_mutex_unlock(&self->mutex));
- if(!threads)
- return;
-
+ if(threads)
{
unsigned i, count = _threadpool_count_parallel(self);
for(i = 0; i != count; ++i)
PTHREAD_VERIFY(pthread_join(threads[i], NULL));
- }
- free(threads);
- PTHREAD_VERIFY(pthread_cond_destroy(&self->cond));
- PTHREAD_VERIFY(pthread_mutex_destroy(&self->mutex));
+ free(threads);
+ PTHREAD_VERIFY(pthread_cond_destroy(&self->cond));
+ PTHREAD_VERIFY(pthread_mutex_destroy(&self->mutex));
+ }
_serial_destroy(self);
}