You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A potentail lamellar-lint: Try to detect when a temporary holds a lock but that temporary is never used again.
asyncfndo_stuff(table:LocalLockArray){let values = table.read_local_data().await;let v = values[0];do_other_stuff(table);}
If do_other_stuff wants to write to table, it will be blocked because the read_lock is held until do_stuff finishes. It would be nice to have a lint that (1) knows what functions grab locks and (2) indicates when those locks probably aren't needed after a certain point (and suggests the temporary be explicitly dropped).
The text was updated successfully, but these errors were encountered:
Discussion with @rdfriese , the idea of only suggesting if the locked structure is passed to another context. However, there might be difficulty around alias detection...
asyncfndo_stuff(table:LocalLockArray){let values = table.read_local_data().await;let v = values[0];let table2 = table;do_other_stuff(table2);}
Not sure when the linter runs, but if the de-aliasing isn't run yet this case would be harder to catch.
A potentail lamellar-lint: Try to detect when a temporary holds a lock but that temporary is never used again.
If
do_other_stuff
wants to write to table, it will be blocked because the read_lock is held untildo_stuff
finishes. It would be nice to have a lint that (1) knows what functions grab locks and (2) indicates when those locks probably aren't needed after a certain point (and suggests the temporary be explicitly dropped).The text was updated successfully, but these errors were encountered: