syscall(SYS_tgkill, vm_tgid_, vm_tid_, SIGPROF);
// Convert ms to us and subtract 100 us to compensate delays
// occuring during signal delivery.
- int result = usleep(sampler_->interval_ * 1000 - 100);
- ASSERT(result == 0 || errno == EINTR);
+ const useconds_t interval = sampler_->interval_ * 1000 - 100;
+ int result = usleep(interval);
+#ifdef DEBUG
+ if (result != 0 && errno != EINTR) {
+ fprintf(stderr,
+ "SignalSender usleep error; interval = %u, errno = %d\n",
+ interval,
+ errno);
+ ASSERT(result == 0 || errno == EINTR);
+ }
+#endif
USE(result);
}
}
Sampler::~Sampler() {
+ ASSERT(!data_->signal_sender_launched_);
delete data_;
}