Merge branch 'sx/pthread-error-check-fix'