islet
islet copied to clipboard
Enhance locking mechanism
When double-locking occurs, it is hard to detect. (just hang) One example of double-locking is that lock two granules with same address. This occurred in realm-creation test of ACS. https://github.com/Samsung/islet/pull/155
Suggestion 1
- Add
try_lock
I think too we need this.
The best way IMO, only considering "security" not "usability" is to enforce accessing to granule inside closure, and then, make sure that no APIs to lock again are exposed within the closure. But, this is not a usable solution, as we may unnecessarily fall into nested closures.
So, I think too try_lock
is a way to go.
Plus, when we deal with this, we may also need to take into account "dead-lock" prevention.
what do you mean by locking two (distinct) granules with the same address?