diff --git a/Source/NSThread.m b/Source/NSThread.m index a5c43acfe..454001d40 100644 --- a/Source/NSThread.m +++ b/Source/NSThread.m @@ -912,12 +912,13 @@ pthread_detach(pthread_self()); */ _active = YES; + errno = 0; if (objc_thread_detach(@selector(main), self, nil) == NULL) { _active = NO; RELEASE(self); [NSException raise: NSInternalInconsistencyException - format: @"Unable to detach thread (perhaps %@)", + format: @"Unable to detach thread (last error %@)", [NSError _last]]; } }