Saturday, 7 September 2019

std::condition_variable will work correctly with std::chrono::steady_clock in GCC 10!

In a previous blog post I lamented the lack of proper support for std::chrono::steady_clock in libstdc++’s implementation of std::condition_variable. I’m pleased to say that this problem will be solved when GCC 10 is released.
In the end, I managed to guide the “Invent a new pthreads function” solution through the Austin Group, although my proposed pthread_cond_timedwaitonclock function became simply pthread_cond_clockwait and was joined by pthread_mutex_clocklock, pthread_rwlock_clockwrlock, pthread_rwlock_clockrdlock and sem_clockwait along the way. These new functions are available in glibc v2.30.
Once pthread_cond_clockwait was available in glibc, it was straightforward to fix libstdc++’s std::condition_variable to use it.
Thanks to Adhemerval Zanella for reviewing the new glibc functions and Jonathan Wakely for reviewing the libstdc++ changes.

Sunday, 17 February 2019

Making the SD activity LED work on the Raspberry Pi 3 AArch64 Debian Buster image

I tried installing Gunnar Wolf's Debian Buster Image on my Raspberry Pi 3. I found that the SD card activity LED didn't work by default. This can easily be fixed (until the next reboot) with:

echo mmc0 > /sys/class/leds/ACT/trigger

Attempting to set the trigger to the more generic disk-activity didn't seem to work.