Re: [PATCH] gcc 2.95 fixes
| Newsgroups | gmane.comp.emulators.winex.devel |
|---|---|
| Message-ID | <[email protected]> |
On Fri, 26 Mar 2004, Bryan Kadzban wrote: > [email protected] wrote: > > The attached patch makes gcc 2.95 happy. Also it is just good > > practice to declare variables at the top of their scope. I'd > > appreciate it if it was applied to CVS. > > It may make gcc happy to declare variables at the top, but it'll make > the system much, much happier to initialize variables where they had > been initialized before. *ESPECIALLY* when that initialization is going > to affect inter-thread synchronization... > > The second patch (the one in http.c) isn't going to affect anything, but > the first one (in critsection.c) could very easily deadlock. > > It's much better to actually wait on the critical section's semaphore in > the same place that it's being waited on in the current CVS code (i.e., > *after* the entry and contention counts are atomically incremented, not > before -- otherwise, if the atomic increment affects the signaled state > of the semaphore, then your patch could cause a deadlock). Something > like the attached is going to be a lot safer (plus it applies more > cleanly to current CVS). That's better than my patch. Obviously mine was just a quick hack without bothering to see what all was going on. -- <Douglas Leonard> <[email protected]>