mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Merge branch 'master' of github.com:gnustep/libs-base into NSSecureCoding_branch2
This commit is contained in:
commit
597f0a917e
10 changed files with 183 additions and 96 deletions
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue