| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
SummaryI changed the way i check for exceptions when attempting to acquire semaphores to avoid accessing the node pointer which might have moved to the semaphore queue. Also update the second test I added to allow exclusive access to the variable captured by reference. Testingthe changes were tested with the compile flag -fsanitize=thread using clang on an arch system and passed all unittests with no warnings. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
#732
Summary:
I have added a DFS recursive method , _handle_broken_semaphores, to the tf::Node class to remove deadlocks that happen because of exceptions thrown down the chain. This is done via calling it on all preceding nodes stored in _edges vector. The method is similar to tf::Semaphore::_release taking a reference to a SmallVector of Node * and storing the waiter nodes' pointers so they can be rescheduled removing the deadlock. There's also an unordered set to handle loops. I also added a new state, _is_broken, to the tf::Semaphore class which prevents acquiring a semaphore that has had an exception until it's reset.
Tests and benchmarks:
Notes:
This is my first time contributing and I would welcome any kind of feedback and I am open to adding more test/ documentation to my changes.