Hi, I've a couple of comments related to synchronization primitives too.
* AmMutex and AmCondition wrappers do not check the return values of pthread_* functions. I think it would be pretty useful for debugging. * AmCondition is obviously not the real "condition variable" (as one is taught in the school) and its usage is quite limited because it actually owns the mutex and the value. Simplier (and more versatile) wrapper to pthread_cond_t might be useful too; often it can replace AmCondition<bool> flags in SEMS. * There is no way how to check whether some events are pending in an event queue (AmEventQueue). Either processEvent()/waitForEvent() may block or processSingleEvent() doesn't even tell the caller whether it did anything. So, isEmpty() method would be useful. * There is no way for a thread (AmThread) to wait for its "_stopped" flag. At least, the flag should be "protected" rather than private. Regards --ondra On Wed 14 Apr 2010 03:09:32 PM CEST, Robert Szokovacs wrote: > Hi, > > I started using AmCondition and noticed it didn't wrap > pthread_cond_timedwait(). As I couldn't use UserTimer because I wait > in onInvite() so the timeout events don't get delivered, I added the > functionality to AmCondition. Patch attached. > > br > > Szo _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
