[ovs-dev] [PATCH 2/2] stream: Call WSAStartup() before calling any winsock functions.

Ben Pfaff blp at nicira.com
Mon Mar 17 22:16:42 UTC 2014


On Mon, Mar 17, 2014 at 02:55:09PM -0700, Gurucharan Shetty wrote:
> On Mon, Mar 17, 2014 at 2:10 PM, Ben Pfaff <blp at nicira.com> wrote:
> > On Mon, Mar 17, 2014 at 01:13:32PM -0700, Gurucharan Shetty wrote:
> >> The WSAStartup function initiates use of the Winsock DLL by a process.
> >> The function should be called before any winsock related functions
> >> are called.
> >>
> >> Since, we use stream-fd-windows through pstream_open or stream_open
> >> add the WSAStartup() call there.
> >>
> >> The current version of the Windows Sockets specification is version 2.2
> >>
> >> Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
> >
> > Should we use pthread_once()?
> If I am not wrong, stream.c is only called from single thread (main
> thread), isn't it? Do we still need pthread_once()?

I think you're right for now, but I'd still prefer to make it as
thread safe as we can, at least when it's as easy as a pthread_once()
call.  I don't like pitfalls.



More information about the dev mailing list