Merge branch 'master' of github.com:gnustep/libs-base into NSSecureCoding_branch2

This commit is contained in:
Gregory John Casamento 2020-05-31 17:41:23 -04:00
commit 597f0a917e
10 changed files with 183 additions and 96 deletions

View file

@ -40,12 +40,8 @@
#if defined(_WIN32)
#if defined(__WIN64__)
#include <winsock2.h>
#endif
#include <io.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <wininet.h>
#if !defined(EAFNOSUPPORT)

View file

@ -763,6 +763,7 @@ GSCurrentThreadDictionary(void)
static void
gnustep_base_thread_callback(void)
{
static pthread_mutex_t threadLock = PTHREAD_MUTEX_INITIALIZER;
/*
* Protect this function with locking ... to avoid any possibility
* of multiple threads registering with the system simultaneously,
@ -771,9 +772,10 @@ gnustep_base_thread_callback(void)
*/
if (entered_multi_threaded_state == NO)
{
[gnustep_global_lock lock];
pthread_mutex_lock(&threadLock);
if (entered_multi_threaded_state == NO)
{
ENTER_POOL
/*
* For apple compatibility ... and to make things easier for
* code called indirectly within a will-become-multi-threaded
@ -814,8 +816,9 @@ gnustep_base_thread_callback(void)
fflush(stderr);
}
NS_ENDHANDLER
LEAVE_POOL
}
[gnustep_global_lock unlock];
pthread_mutex_unlock(&threadLock);
}
}
@ -862,6 +865,7 @@ unregisterActiveThread(NSThread *thread)
{
/* Let observers know this thread is exiting.
*/
ENTER_POOL
if (nc == nil)
{
nc = RETAIN([NSNotificationCenter defaultCenter]);
@ -877,6 +881,7 @@ unregisterActiveThread(NSThread *thread)
thread->_finished = YES;
[(GSRunLoopThreadInfo*)thread->_runLoopInfo invalidate];
LEAVE_POOL
RELEASE(thread);
pthread_setspecific(thread_object_key, nil);
}

View file

@ -22,14 +22,8 @@
Boston, MA 02111 USA.
*/
#if defined(__WIN64__)
#include <winsock2.h>
#include <windows.h>
#else
/* mingw32 wants winsock2.h before windows.h */
#include <windows.h>
#include <winsock2.h>
#endif
#include "common.h"
#define EXPOSE_NSFileHandle_IVARS 1