~afrantzis/mir/texture-bindable

Viewing all changes in revision 2864.

Make Alarm::cancel() safe to call from within the Alarm callback.

While it's never necessary to do this - because alarms are one-shot, once a thread has reached the callback the alarm will never be triggered again unless rescheduled - it can be convenient to have code that is both called from inside an alarm callback and from outside.

A std::recursive_mutex is only slightly less efficient than a std::mutex, so make this code not deadlock.

Approved by PS Jenkins bot, Daniel van Vugt, Cemil Azizoglu.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: