2003-10-26 13:45:49 +00:00
|
|
|
/** Some extra locking classes
|
|
|
|
|
|
|
|
Copyright (C) 2003 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Written by: Richard Frith-Macdonald <rfm@gnu.org>
|
|
|
|
|
|
|
|
This file is part of the GNUstep Base Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
2007-09-14 11:36:11 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
2003-10-26 13:45:49 +00:00
|
|
|
License as published by the Free Software Foundation; either
|
2008-06-08 10:38:33 +00:00
|
|
|
version 2 of the License, or (at your option) any later version.
|
2003-10-26 13:45:49 +00:00
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
2007-09-14 11:36:11 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2003-10-26 13:45:49 +00:00
|
|
|
License along with this library; if not, write to the Free
|
2006-09-13 10:20:49 +00:00
|
|
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02111 USA.
|
2003-10-26 13:45:49 +00:00
|
|
|
|
|
|
|
AutogsdocSource: Additions/GSLock.m
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef INCLUDED_GS_LOCK_H
|
|
|
|
#define INCLUDED_GS_LOCK_H
|
|
|
|
|
2003-11-10 15:34:52 +00:00
|
|
|
#ifndef NeXT_Foundation_LIBRARY
|
2010-03-10 14:53:51 +00:00
|
|
|
#import <Foundation/NSLock.h>
|
2003-11-10 15:34:52 +00:00
|
|
|
#else
|
2010-03-10 14:53:51 +00:00
|
|
|
#import <Foundation/Foundation.h>
|
2003-11-10 15:34:52 +00:00
|
|
|
#endif
|
2003-10-26 13:45:49 +00:00
|
|
|
|
2010-03-10 14:53:51 +00:00
|
|
|
#import "GNUstepBase/GSObjCRuntime.h"
|
2007-12-20 14:36:15 +00:00
|
|
|
|
2006-09-13 10:20:49 +00:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2003-10-30 13:44:55 +00:00
|
|
|
@class NSNotification;
|
|
|
|
|
2003-10-26 13:45:49 +00:00
|
|
|
@interface GSLazyLock : NSLock
|
|
|
|
{
|
|
|
|
int locked;
|
|
|
|
}
|
|
|
|
- (void) _becomeThreaded: (NSNotification*)n;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface GSLazyRecursiveLock : NSRecursiveLock
|
|
|
|
{
|
|
|
|
int counter;
|
|
|
|
}
|
|
|
|
- (void) _becomeThreaded: (NSNotification*)n;
|
|
|
|
@end
|
|
|
|
|
2007-12-19 14:39:44 +00:00
|
|
|
/** Global lock to be used by classes when operating on any global
|
|
|
|
data that invoke other methods which also access global; thus,
|
|
|
|
creating the potential for deadlock. */
|
|
|
|
GS_EXPORT NSRecursiveLock *gnustep_global_lock;
|
|
|
|
|
2006-09-13 10:20:49 +00:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
2003-10-26 13:45:49 +00:00
|
|
|
|
2006-09-13 10:20:49 +00:00
|
|
|
#endif /* INCLUDED_GS_LOCK_H */
|