fadeevab / cliclack

Beautiful, minimal, opinionated CLI prompts inspired by the Clack NPM package
MIT License
216 stars 15 forks source link

[chore] Replace `Mutex` with `RwLock` for themes #41

Open cylewitruk opened 7 months ago

cylewitruk commented 7 months ago

Since the theme is write-once, read-many, I think a RwLock would be more appropriate than a Mutex. I remember running into deadlocks on accident when writing the multiprogress suggestion PR, and this would simply make it easier to avoid such caveats.

fadeevab commented 7 months ago

@cylewitruk It sounds reasonable, I remember running into deadlocks too, however, due to urgency, I evaded deadlocks via timely unlocking.

cylewitruk commented 7 months ago

@cylewitruk It sounds reasonable, I remember running into deadlocks too, however, due to urgency, I evaded deadlocks via timely unlocking.

Yeah no I get it, I just ran into this with my own theme handling using Mutex and resolved with RwLock, hence I I bring it up here 😊