Duplicate :
|
We currently have two use patterns of the SuspendibleThreadSet. In most cases a SuspendibleThreadSetJoiner is placed on the stack. This is nice because ensures that you don't forget to leave the set. The other cases use direct calls to SuspendibleThreadSet::join() and SuspendibleThreadSet::leave(), and this is typically used when there's a need to temporary leave the set in the middle of some block of logic. I propose that we add a SuspendibleThreadSetLeaver to accompany the SuspendibleThreadSetJoiner and make it the only way to join/leave the set.