mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Fix possible deadlock when becoming multi-threaded.
This commit is contained in:
parent
8e97401783
commit
a7e87824c0
2 changed files with 11 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2020-07-06 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Source/NSThread.m: Fix possible deadlock when becoming multi-
|
||||
threaded.
|
||||
|
||||
2020-06-14 Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Headers/Foundation/NSKeyedArchiver.h
|
||||
|
|
|
@ -775,7 +775,6 @@ gnustep_base_thread_callback(void)
|
|||
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
|
||||
|
@ -783,6 +782,12 @@ gnustep_base_thread_callback(void)
|
|||
* threaded BEFORE sending the notifications.
|
||||
*/
|
||||
entered_multi_threaded_state = YES;
|
||||
/*
|
||||
* Enter pool after setting flag, because -[NSAutoreleasePool
|
||||
* allocWithZone:] calls GSCurrentThread(), which may end up
|
||||
* calling this function, which would cause a deadlock.
|
||||
*/
|
||||
ENTER_POOL
|
||||
NS_DURING
|
||||
{
|
||||
[GSPerformHolder class]; // Force initialization
|
||||
|
|
Loading…
Reference in a new issue