From 4c40f9c6351fc7ef18efff290879b81b680caaf6 Mon Sep 17 00:00:00 2001 From: Skirmantas Kligys Date: Mon, 3 Feb 2020 16:19:32 -0800 Subject: [PATCH] Stop using a mutex for guarding CachedCalendar. --- src/modules/clock.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/modules/clock.cpp b/src/modules/clock.cpp index 134288ce..ef79274e 100644 --- a/src/modules/clock.cpp +++ b/src/modules/clock.cpp @@ -1,5 +1,4 @@ #include "modules/clock.hpp" -#include #include using zoned_time = date::zoned_time; @@ -37,14 +36,11 @@ struct CachedCalendar { } }; -std::mutex cached_calendar_mutex; // protects cached_calendar. CachedCalendar cached_calendar; std::string calendar_text(const waybar_time& wtime, const date::weekday& first_dow) { const auto daypoint = date::floor(wtime.ztime.get_local_time()); const auto ymd = date::year_month_day(daypoint); - - const std::lock_guard lock(cached_calendar_mutex); if (cached_calendar.ymd == ymd) { return cached_calendar.text; }