# std: Windows: WSASocketW ensures WSAStartup · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/61850f88835bfc71682f9c57c28c7e64080f1389)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 61850f88835bfc71682f9c57c28c7e64080f1389

Requested commit: 61850f88835bfc71682f9c57c28c7e64080f1389

Commit: 61850f88835bfc71682f9c57c28c7e64080f1389

Tree: fea6cc389f253380903695015f7638ca9d94db9d

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std: Windows: WSASocketW ensures WSAStartup

When WSASocketW gets WSANOTINITIALISED, now it will lock a mutex to
safely call WSAStartup and then try again one time.

This implementation:
 * Does not use recursion
 * Contains a detailed doc comment explaining why things are how they are
 * Is careful about which errors are surfaced in the respective error
   sets. `std.os.socket` intentionally does not have "not initialised"
   as one of the possible errors.

```

## Parents

- [85c2ffc9ba3153fbc5d295b2bc698b5bf0344d0e](https://git.cafe/gitcafe/zig/commit/85c2ffc9ba3153fbc5d295b2bc698b5bf0344d0e?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/61850f88835bfc71682f9c57c28c7e64080f1389?format=markdown)
