On Mon, Jun 18, 2012 at 02:23:11PM -0700, Danek Duvall wrote: > Edward Pilatowicz wrote: > > > On Mon, Jun 18, 2012 at 01:15:04PM -0700, Danek Duvall wrote: > > > Edward Pilatowicz wrote: > > > > > > But I wonder if it should look more like the _LockedCancelable class > > > (I'm not sure why that was implemented as a class rather than a > > > function), or whether you should go even further and simply use the > > > _LockedCancelable class, possibly modifying the __call__() method to > > > give it different behavior in some circumstances. > > > > > > > i structured this function based on other code that grabs the activity > > and image lock. for example __plan_common_start(). > > > > _LockedGenerator() has a bit more complexity and it's comments say that > > it's designed to wrap generator functions it's wrapper routine invokes > > yield() but i need my routine to invoke return, and i've had very bad > > experiences debugging functions that mix yield and return. to mitigate > > risk i'd like to leave this as is for now. > > Okay. Though I didn't say _LockedGenerator, I said _LockedCancelable, > which does return and not yield. >
ah. my bad. ok. i've removed my __activity_lock() decorator and replaced it with _LockedCancelable(). (i also updated _LockedCancelable() to drop image lock if the thread acquired it.) ed _______________________________________________ pkg-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
