| 100 | } |
| 101 | |
| 102 | bool InfoThread::start(const InfoThreadOptions& options) { |
| 103 | if (options.latency_recorder == NULL || |
| 104 | options.error_count == NULL || |
| 105 | options.sent_count == NULL) { |
| 106 | LOG(ERROR) << "Some required options are NULL"; |
| 107 | return false; |
| 108 | } |
| 109 | _options = options; |
| 110 | _stop = false; |
| 111 | if (pthread_create(&_tid, NULL, run_info_thread, this) != 0) { |
| 112 | LOG(ERROR) << "Fail to create info_thread"; |
| 113 | return false; |
| 114 | } |
| 115 | return true; |
| 116 | } |
| 117 | |
| 118 | void InfoThread::stop() { |
| 119 | { |
no outgoing calls