mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 12:00:45 +00:00
gnustep_global_lock is removed
This commit is contained in:
parent
276d12da9f
commit
7a98157dc7
4 changed files with 18 additions and 21 deletions
|
@ -1,3 +1,10 @@
|
|||
2024-05-30 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/GSDisplayServer.m:
|
||||
* Source/NSGraphicsContext.m:
|
||||
* Source/NSWorkspace.m:
|
||||
Avoid using old gnustep_global_lock (removed from base)
|
||||
|
||||
2024-05-26 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* ChangeLog: Update for new release
|
||||
|
|
|
@ -123,7 +123,6 @@ GSCurrentServer(void)
|
|||
{
|
||||
if (serverLock == nil)
|
||||
{
|
||||
[gnustep_global_lock lock];
|
||||
if (serverLock == nil)
|
||||
{
|
||||
serverLock = [NSRecursiveLock new];
|
||||
|
@ -132,7 +131,6 @@ GSCurrentServer(void)
|
|||
windowmaps = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks,
|
||||
NSNonOwnedPointerMapValueCallBacks, 20);
|
||||
}
|
||||
[gnustep_global_lock unlock];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -138,7 +138,6 @@ NSGraphicsContext *GSCurrentContext(void)
|
|||
{
|
||||
if (contextLock == nil)
|
||||
{
|
||||
[gnustep_global_lock lock];
|
||||
if (contextLock == nil)
|
||||
{
|
||||
contextLock = [NSRecursiveLock new];
|
||||
|
@ -147,7 +146,6 @@ NSGraphicsContext *GSCurrentContext(void)
|
|||
classMethodTable =
|
||||
[[NSMutableDictionary allocWithZone: _globalGSZone] init];
|
||||
}
|
||||
[gnustep_global_lock unlock];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -131,6 +131,7 @@ static NSImage *multipleFiles = nil;
|
|||
static NSImage *unknownApplication = nil;
|
||||
static NSImage *unknownTool = nil;
|
||||
|
||||
static NSLock *classLock = nil;
|
||||
static NSLock *mlock = nil;
|
||||
|
||||
static NSString *GSWorkspaceNotification = @"GSWorkspaceNotification";
|
||||
|
@ -598,26 +599,22 @@ static NSDictionary *urlPreferences = nil;
|
|||
{
|
||||
if (self == [NSWorkspace class])
|
||||
{
|
||||
static BOOL beenHere = NO;
|
||||
NSFileManager *mgr = [NSFileManager defaultManager];
|
||||
NSString *service;
|
||||
NSData *data;
|
||||
NSDictionary *dict;
|
||||
|
||||
[self setVersion: 1];
|
||||
|
||||
[gnustep_global_lock lock];
|
||||
if (beenHere == YES)
|
||||
if (classLock)
|
||||
{
|
||||
[gnustep_global_lock unlock];
|
||||
return;
|
||||
}
|
||||
|
||||
beenHere = YES;
|
||||
classLock = [NSLock new];
|
||||
mlock = [NSLock new];
|
||||
|
||||
NS_DURING
|
||||
{
|
||||
NSFileManager *mgr = [NSFileManager defaultManager];
|
||||
NSString *service;
|
||||
NSData *data;
|
||||
NSDictionary *dict;
|
||||
|
||||
|
||||
service = [[NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
|
||||
NSUserDomainMask, YES) objectAtIndex: 0]
|
||||
stringByAppendingPathComponent: @"Services"];
|
||||
|
@ -675,12 +672,9 @@ static NSDictionary *urlPreferences = nil;
|
|||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
[gnustep_global_lock unlock];
|
||||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER
|
||||
|
||||
[gnustep_global_lock unlock];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -698,14 +692,14 @@ static NSDictionary *urlPreferences = nil;
|
|||
{
|
||||
if (sharedWorkspace == nil)
|
||||
{
|
||||
[gnustep_global_lock lock];
|
||||
[classLock lock];
|
||||
if (sharedWorkspace == nil)
|
||||
{
|
||||
sharedWorkspace =
|
||||
(NSWorkspace*)NSAllocateObject(self, 0, NSDefaultMallocZone());
|
||||
[sharedWorkspace init];
|
||||
}
|
||||
[gnustep_global_lock unlock];
|
||||
[classLock unlock];
|
||||
}
|
||||
return sharedWorkspace;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue