RE: ithread_cond_wait in ithread library
"The SZ" <[email protected]> Mon, 18 Jul 2005 18:30:52 +0000
| Newsgroups | gmane.linux.upnp-sdk.general |
|---|---|
| Message-ID | <[email protected]> |
well, ithread_mutex_lock and ithread_mutex_unlock don't check the result code. it seems that CreateWorker is waiting with ithread_cond_wait() for the event, but this never happen because WorkerThread() is waiting for ithread_mutex_lock() before setting ithread_cond_broadcast(). After a little playing this is working, but now it hangs in the 'wait for jobs loop'. I guess the locks are not working correctly in snapgear. ithread_cond_timedwait() is supposed to leave the mutex before waiting and entering after return. but I'm not sure whether this is always happen. I'm talking about ThreadPool.c from libupnp-1.2.1a.tar.tar Steffen >From: "Alexander Gdalevich" <[email protected]> >To: [email protected], [email protected] >Subject: RE: [UPnP-SDK-discuss] ithread_cond_wait in ithread library >Date: Mon, 18 Jul 2005 14:23:29 -0400 >MIME-Version: 1.0 >X-Originating-IP: [64.4.56.200] >X-Originating-Email: [[email protected]] >X-Sender: [email protected] >Received: from hotmail.com ([64.4.56.45]) by mc12-f7.hotmail.com with >Microsoft SMTPSVC(6.0.3790.211); Mon, 18 Jul 2005 11:23:29 -0700 >Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; >Mon, 18 Jul 2005 11:23:29 -0700 >Received: from 64.4.56.200 by by101fd.bay101.hotmail.msn.com with HTTP;Mon, >18 Jul 2005 18:23:29 GMT >X-Message-Info: JGTYoYF78jEHjJx36Oi8+Z3TmmkSEdPtfpLB7P/ybN8= >X-OriginalArrivalTime: 18 Jul 2005 18:23:29.0571 (UTC) >FILETIME=[CBE7C730:01C58BC5] >Return-Path: [email protected] > > >You mean code like : ithread_mutex_lock( &tp->mutex ); does not work. > >There could be a few things wrong. First, the UPNP code assumes that the >function will return zero on success and non-zero on failure. Not all >thread libraries work this way, you may want to make sure that yours works >this way. You may also want to make sure that the mutex is properly >initialized. > >Good luck. > > >---------------------------------------------------------------- >"Normal people ... believe that if it ain't broke, don't fix it. Engineers >believe that if it ain't broke, it doesn't have enough features yet." > > > > >>From: "The SZ" <[email protected]> >>To: [email protected] >>Subject: [UPnP-SDK-discuss] ithread_cond_wait in ithread library >>Date: Mon, 18 Jul 2005 16:47:32 +0000 >> >>Hi, >> >>I have the same problem as Maryam, the tp->mutex lock doesn't work in >>CreateWorker/ThreadPoolInit . I'm using Snapgear too. >> >>Does anyone has some clues? >> >>Steffen >> >> >> >> >>------------------------------------------------------- >>SF.Net email is sponsored by: Discover Easy Linux Migration Strategies >>from IBM. Find simple to follow Roadmaps, straightforward articles, >>informative Webcasts and more! Get everything you need to get up to >>speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click >>_______________________________________________ >>UPnP-SDK-discuss mailing list >>[email protected] >>https://lists.sourceforge.net/lists/listinfo/upnp-sdk-discuss > > ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click