Fix error handling for pthread functions
Set errno to return value of pthread_* functions during error. All pthread macros now handle errors in the same way. Do not set errno immediately, because in threaded programs errno is a macro that expands into a function call. We don't want to incur that performance cost unless it's actually an error. See The Linux Programming Interface, 3.5.2 (pg.53) and 29.2 (pg 621). Bug 5901
Please register or sign in to comment