Daniel, Alessandro, quick question: I prepared a patch for upstream Gnome Shell ( https://gitlab.gnome.org/GNOME/gnome- shell/-/merge_requests/3640 ), but maybe a different syntax could be better. Specifically, to add this to the "AsyncMutex" class:
+ + async asyncCriticalSection(f, ...args) { + await this.hold(); + try { + await f(...args); + } finally { + this.release(); + } + } And then, call the code with await onEnabledExtensionsChangedMutex.asyncCriticalSection(async () => { ... // the code that must run without being preempted ... }); This way, it would be cleaner, and the logic to ensure that the "mutex" is released even if an exception happens is fully integrated into the "mutex" class, while still ensuring that any non catched exception is still correctly passed. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2098102 Title: Desktop switching shows windows from previous desktop To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/2098102/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs