wxSocket::Initialize() and Shutdown() are for main thread only.

Calling Initialize() from another thread could never work before but it wasn't
clear that this was the case so document it in the functions comments and
documentation now and add asserts checking that they are called from the main
thread only.

Also simplify the code as we don't actually need to do any reference-counting
here and a simple boolean flag indicating whether the sockets are initialized
is enough.

Closes #11119.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61985 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-09-21 08:44:35 +00:00
parent 7b7ad6a7f2
commit 4017f5ca49
3 changed files with 49 additions and 27 deletions

View File

@@ -710,6 +710,8 @@ public:
does anything) but you must call Shutdown() exactly once for every call
to Initialize().
This function should only be called from the main thread.
@return
@true if the sockets can be used, @false if the initialization
failed and sockets are not available at all.
@@ -721,6 +723,9 @@ public:
This function undoes the call to Initialize() and must be called after
every successful call to Initialize().
This function should only be called from the main thread, just as
Initialize().
*/
static void Shutdown();