mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Merge pull request #317 from gnustep/NSLock_fix_issue316
This commit is contained in:
commit
dbfbf3766a
2 changed files with 37 additions and 2 deletions
|
@ -36,12 +36,14 @@
|
|||
#import "GSPrivate.h"
|
||||
#import "GSPThread.h"
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#import "common.h"
|
||||
|
||||
#import "Foundation/NSLock.h"
|
||||
#import "Foundation/NSException.h"
|
||||
#import "Foundation/NSThread.h"
|
||||
// #import "Foundation/NSUserDefaults.h"
|
||||
|
||||
#define class_createInstance(C,E) NSAllocateObject(C,E,NSDefaultMallocZone())
|
||||
|
||||
|
@ -247,8 +249,16 @@ static BOOL traceLocks = NO;
|
|||
{\
|
||||
if (0 != GS_MUTEX_UNLOCK(_mutex))\
|
||||
{\
|
||||
[NSException raise: NSLockException\
|
||||
format: @"failed to unlock mutex"];\
|
||||
if (GSPrivateDefaultsFlag(GSMacOSXCompatible))\
|
||||
{\
|
||||
NSLog(@"Failed to unlock mutex %@ at %@",\
|
||||
self, [NSThread callStackSymbols]);\
|
||||
}\
|
||||
else \
|
||||
{\
|
||||
[NSException raise: NSLockException\
|
||||
format: @"failed to unlock mutex %@", self];\
|
||||
}\
|
||||
}\
|
||||
CHK(Drop) \
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue