X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/fa7225c82381bac4432a6edf16f53b5370238d85..02b2aca600d4a0fe6fb259262bd6808ef889acde:/OSX/libsecurity_utilities/lib/threading.cpp diff --git a/OSX/libsecurity_utilities/lib/threading.cpp b/OSX/libsecurity_utilities/lib/threading.cpp index 4146c3f4..4472c7f7 100644 --- a/OSX/libsecurity_utilities/lib/threading.cpp +++ b/OSX/libsecurity_utilities/lib/threading.cpp @@ -255,6 +255,7 @@ Thread::~Thread() void Thread::run() { + pthread_t pt; pthread_attr_t ptattrs; int err, ntries = 10; // 10 is arbitrary @@ -263,7 +264,7 @@ void Thread::run() { syslog(LOG_ERR, "error %d setting thread detach state", err); } - while ((err = pthread_create(&self.mIdent, &ptattrs, runner, this) && + while ((err = pthread_create(&pt, &ptattrs, runner, this) && --ntries)) { syslog(LOG_ERR, "pthread_create() error %d", err); @@ -274,7 +275,7 @@ void Thread::run() syslog(LOG_ERR, "too many failed pthread_create() attempts"); } else - secinfo("thread", "%p created", self.mIdent); + secinfo("thread", "%p created", pt); } void *Thread::runner(void *arg) @@ -283,9 +284,9 @@ void *Thread::runner(void *arg) // otherwise it will crash if something underneath throws. { Thread *me = static_cast(arg); - secinfo("thread", "%p starting", me->self.mIdent); + secinfo("thread", "%p starting", pthread_self()); me->action(); - secinfo("thread", "%p terminating", me->self.mIdent); + secinfo("thread", "%p terminating", pthread_self()); delete me; return NULL; }