| 76 | } |
| 77 | |
| 78 | void Comment::Start(bool runtimeCreated) |
| 79 | { |
| 80 | ObjectImpl<Comment>::Start(runtimeCreated); |
| 81 | |
| 82 | static boost::once_flag once = BOOST_ONCE_INIT; |
| 83 | |
| 84 | boost::call_once(once, [] { |
| 85 | l_CommentsExpireTimer = Timer::Create(); |
| 86 | l_CommentsExpireTimer->SetInterval(60); |
| 87 | l_CommentsExpireTimer->OnTimerExpired.connect([](const Timer * const&) { CommentsExpireTimerHandler(); }); |
| 88 | l_CommentsExpireTimer->Start(); |
| 89 | }); |
| 90 | |
| 91 | { |
| 92 | std::unique_lock<std::mutex> lock(l_CommentMutex); |
| 93 | |
| 94 | SetLegacyId(l_NextCommentID); |
| 95 | l_LegacyCommentsCache[l_NextCommentID] = GetName(); |
| 96 | l_NextCommentID++; |
| 97 | } |
| 98 | |
| 99 | GetCheckable()->RegisterComment(this); |
| 100 | |
| 101 | if (runtimeCreated) |
| 102 | OnCommentAdded(this); |
| 103 | } |
| 104 | |
| 105 | void Comment::Stop(bool runtimeRemoved) |
| 106 | { |
no test coverage detected