mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
More changes to make lock tracking more robust
This commit is contained in:
parent
603c3b1103
commit
cc7a146796
6 changed files with 107 additions and 57 deletions
|
@ -60,12 +60,38 @@ static Class untracedRecursiveLockClass = Nil;
|
|||
|
||||
static BOOL traceLocks = NO;
|
||||
|
||||
void
|
||||
GSPrivateTraceLocks(BOOL aFlag)
|
||||
@implementation NSObject (GSTraceLocks)
|
||||
|
||||
+ (BOOL) shouldCreateTraceableLocks: (BOOL)shouldTrace
|
||||
{
|
||||
traceLocks = (aFlag ? YES : NO);
|
||||
BOOL old = traceLocks;
|
||||
|
||||
traceLocks = shouldTrace ? YES : NO;
|
||||
return old;
|
||||
}
|
||||
|
||||
+ (NSCondition*) tracedCondition
|
||||
{
|
||||
return AUTORELEASE([GSTracedCondition new]);
|
||||
}
|
||||
|
||||
+ (NSConditionLock*) tracedConditionLockWithCondition: (NSInteger)value
|
||||
{
|
||||
return AUTORELEASE([[GSTracedConditionLock alloc] initWithCondition: value]);
|
||||
}
|
||||
|
||||
+ (NSLock*) tracedLock
|
||||
{
|
||||
return AUTORELEASE([GSTracedLock new]);
|
||||
}
|
||||
|
||||
+ (NSRecursiveLock*) tracedRecursiveLock
|
||||
{
|
||||
return AUTORELEASE([GSTracedRecursiveLock new]);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
/* In untraced operations these macros do nothing.
|
||||
* When tracing they are defined to perform the trace methods of the thread.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue