void Thread::run()
{
+ pthread_t pt;
pthread_attr_t ptattrs;
int err, ntries = 10; // 10 is arbitrary
{
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);
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)
// otherwise it will crash if something underneath throws.
{
Thread *me = static_cast<Thread *>(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;
}