Closed davetcc closed 3 years ago
Will be in the next release due shortly
Needs more thought before putting it into the code base for the sake of compatibility. The biggest issue here is that if the yieldForMicros call is within a lock, and that also locks, then you have a classic deadlock. My immediate thoughts are to handle this by only supporting a tryLock instead of a full lock.
Internally questioning if this is the right approach, certainly cannot be done as currently implemented.
We've got this now, allowing task wide locks is working, and we've added an asynchronous mode too, so if the locks are in an observer -> observable pattern it can still work by making one side async.
This is now in extended testing, releasing soon
One missing feature in task manager is the ability to handle reentrant locking within a task. For example, that means suppose we have a lock on I2C for example, that we lock in method A, and then method A then callls method B, which again locks I2C, which should succeed as it's locked by the same running task. However, a lock from any other task would have to spin wait by calling back into the task manager yield function.
This requires the currently running task to be exposed on the task manager object.