[FFmpeg-devel] [RFC] Removing non-pthreads support

Gianluigi Tiesi mplayer
Wed Apr 21 21:57:21 CEST 2010


On Tue, Apr 20, 2010 at 10:12:07PM -0300, Ramiro Polla wrote:
> On Tue, Apr 20, 2010 at 9:37 PM, Gianluigi Tiesi <mplayer at netfarm.it> wrote:
> > On Tue, Apr 20, 2010 at 08:36:23PM -0300, Ramiro Polla wrote:
> >> On Tue, Apr 20, 2010 at 6:50 PM, Gianluigi Tiesi <mplayer at netfarm.it> wrote:
> >> > On Tue, Apr 20, 2010 at 05:20:09PM +0100, M?ns Rullg?rd wrote:
> >> >> Gianluigi Tiesi <mplayer at netfarm.it> writes:
> >> >> > On Mon, Apr 19, 2010 at 11:29:44PM -0300, Ramiro Polla wrote:
> >> >> >> this is my latest patch against pthreads-win32 CVS 20091019. compiles
> >> >> >> and links and works fine with both gcc and msvc (the later was asked
> >> >> >> by an ffms2 dev) and any combination of those 2. what it does is:
> >> >> >> - remove the false wsock32 dependency
> >> >> >
> >> >> > the dep is not false :D
> >> >>
> >> >> How the f*ck does a threading library end up depending on a socket
> >> >> library?
> >> >
> >> >
> >> > void * pthread_getspecific (pthread_key_t key)
> >> >
> >> > int lasterror = GetLastError ();
> >> > int lastWSAerror = WSAGetLastError ();
> >> > ptr = TlsGetValue (key->key);
> >> > SetLastError (lasterror);
> >> > WSASetLastError (lastWSAerror);
> >>
> >> Right, and my patch does
> >> ? ? ?{
> >> ? ? ? ?int lasterror = GetLastError ();
> >> - ? ? ?int lastWSAerror = WSAGetLastError ();
> >>
> >> ? ? ? ?ptr = TlsGetValue (key->key);
> >>
> >> ? ? ? ?SetLastError (lasterror);
> >> - ? ? ?WSASetLastError (lastWSAerror);
> >> ? ? ?}
> >>
> >> Now where's the WSA dependency? If you wish you may also add a GDI
> >> dependency there, it will still be a false dependency.
> >>
> >> I'm still waiting for your reproducible testcase which proves those
> >> lines are necessary...
> >
> > http://sourceware.org/ml/pthreads-win32/2001/msg00116.html
> >
> > I doubt they want to undo a fix they made some time ago
> 
> I read that already (note it's dated 2001). There's also more on the
> list, and it seems you haven't read the rest.

try by yourself:

#include <stdio.h>
#include <winsock2.h>

int main(void)
{
    DWORD idx = TlsAlloc();
    TlsSetValue(idx, NULL);
    WSASetLastError(4);
    printf("%d\n", WSAGetLastError());
    TlsGetValue(idx);
    printf("%d\n", WSAGetLastError());
}


-- 
Gianluigi Tiesi <sherpya at netfarm.it>
EDP Project Leader
Netfarm S.r.l. - http://www.netfarm.it/
Free Software: http://oss.netfarm.it/



More information about the ffmpeg-devel mailing list