1997-11-03 14:30:13 +00:00
|
|
|
/* Interface for NSDistributedLock for GNUStep
|
|
|
|
Copyright (C) 1997 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Written by: Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
|
|
|
Date: 1997
|
|
|
|
|
|
|
|
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
|
1997-11-03 14:30:13 +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.
|
1997-11-03 14:30:13 +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
|
1997-11-03 14:30:13 +00:00
|
|
|
License along with this library; if not, write to the Free
|
2006-10-31 07:05:46 +00:00
|
|
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02111 USA.
|
1997-11-03 14:30:13 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __NSDistributedLock_h_GNUSTEP_BASE_INCLUDE
|
|
|
|
#define __NSDistributedLock_h_GNUSTEP_BASE_INCLUDE
|
2006-10-31 07:05:46 +00:00
|
|
|
#import <GNUstepBase/GSVersionMacros.h>
|
1997-11-03 14:30:13 +00:00
|
|
|
|
2006-10-31 07:05:46 +00:00
|
|
|
#import <Foundation/NSObject.h>
|
|
|
|
#import <Foundation/NSString.h>
|
|
|
|
#import <Foundation/NSDate.h>
|
1997-11-03 14:30:13 +00:00
|
|
|
|
2006-09-13 10:20:49 +00:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
1997-11-03 14:30:13 +00:00
|
|
|
@interface NSDistributedLock : NSObject
|
|
|
|
{
|
1999-09-16 07:21:34 +00:00
|
|
|
NSString *_lockPath;
|
|
|
|
NSDate *_lockTime;
|
1997-11-03 14:30:13 +00:00
|
|
|
}
|
|
|
|
|
1999-09-16 07:21:34 +00:00
|
|
|
+ (NSDistributedLock*) lockWithPath: (NSString*)aPath;
|
2003-09-04 16:44:37 +00:00
|
|
|
- (id) initWithPath: (NSString*)aPath;
|
1997-11-03 14:30:13 +00:00
|
|
|
|
1999-09-16 07:21:34 +00:00
|
|
|
- (void) breakLock;
|
|
|
|
- (NSDate*) lockDate;
|
|
|
|
- (BOOL) tryLock;
|
|
|
|
- (void) unlock;
|
1997-11-03 14:30:13 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
2006-09-13 10:20:49 +00:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
1997-11-03 14:30:13 +00:00
|
|
|
#endif /* __NSDistributedLock_h_GNUSTEP_BASE_INCLUDE */
|