Skip to content

Commit ba97dc8

Browse files
committed
[lldb] Fix -Wctad-maybe-unsupported in Alarm.cpp (NFC)
llvm-project/lldb/source/Host/common/Alarm.cpp:37:5: error: 'lock_guard' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported] std::lock_guard alarm_guard(m_alarm_mutex); ^
1 parent 6818c7b commit ba97dc8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lldb/source/Host/common/Alarm.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Alarm::Handle Alarm::Create(std::function<void()> callback) {
3434
Handle handle = INVALID_HANDLE;
3535

3636
{
37-
std::lock_guard alarm_guard(m_alarm_mutex);
37+
std::lock_guard<std::mutex> alarm_guard(m_alarm_mutex);
3838

3939
// Create a new unique entry and remember its handle.
4040
m_entries.emplace_back(callback, expiration);
@@ -59,7 +59,7 @@ bool Alarm::Restart(Handle handle) {
5959
const TimePoint expiration = GetNextExpiration();
6060

6161
{
62-
std::lock_guard alarm_guard(m_alarm_mutex);
62+
std::lock_guard<std::mutex> alarm_guard(m_alarm_mutex);
6363

6464
// Find the entry corresponding to the given handle.
6565
const auto it =
@@ -86,7 +86,7 @@ bool Alarm::Cancel(Handle handle) {
8686
return false;
8787

8888
{
89-
std::lock_guard alarm_guard(m_alarm_mutex);
89+
std::lock_guard<std::mutex> alarm_guard(m_alarm_mutex);
9090

9191
const auto it =
9292
std::find_if(m_entries.begin(), m_entries.end(),
@@ -126,7 +126,7 @@ void Alarm::StartAlarmThread() {
126126
void Alarm::StopAlarmThread() {
127127
if (m_alarm_thread.IsJoinable()) {
128128
{
129-
std::lock_guard alarm_guard(m_alarm_mutex);
129+
std::lock_guard<std::mutex> alarm_guard(m_alarm_mutex);
130130
m_exit = true;
131131
}
132132
m_alarm_cv.notify_one();
@@ -154,7 +154,7 @@ lldb::thread_result_t Alarm::AlarmThread() {
154154
//
155155
// Below we only deal with the timeout expiring and fall through for dealing
156156
// with the rest.
157-
std::unique_lock alarm_lock(m_alarm_mutex);
157+
std::unique_lock<std::mutex> alarm_lock(m_alarm_mutex);
158158
if (next_alarm) {
159159
if (!m_alarm_cv.wait_until(alarm_lock, *next_alarm, predicate)) {
160160
// The timeout for the next alarm expired.

0 commit comments

Comments
 (0)