]> err.no Git - sope/blob - libFoundation/Foundation/NSDistributedLock.h
fixed some NGMail framework build issue
[sope] / libFoundation / Foundation / NSDistributedLock.h
1 /* 
2    NSDistributedLock.h
3
4    Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea.
5    All rights reserved.
6
7    Author: Mircea Oancea <mircea@jupiter.elcom.pub.ro>
8
9    This file is part of libFoundation.
10
11    Permission to use, copy, modify, and distribute this software and its
12    documentation for any purpose and without fee is hereby granted, provided
13    that the above copyright notice appear in all copies and that both that
14    copyright notice and this permission notice appear in supporting
15    documentation.
16
17    We disclaim all warranties with regard to this software, including all
18    implied warranties of merchantability and fitness, in no event shall
19    we be liable for any special, indirect or consequential damages or any
20    damages whatsoever resulting from loss of use, data or profits, whether in
21    an action of contract, negligence or other tortious action, arising out of
22    or in connection with the use or performance of this software.
23 */
24
25 #ifndef __NSDistributedLock_h__
26 #define __NSDistributedLock_h__
27
28 #include <Foundation/NSObject.h>
29
30 @class NSString;
31 @class NSDate;
32
33 @interface NSDistributedLock : NSObject
34 {
35     NSString *path;
36     BOOL     locked;
37 }
38
39 // Creating an NSDistributedLock
40 + (NSDistributedLock *)lockWithPath:(NSString *)aPath;
41 - (NSDistributedLock *)initWithPath:(NSString *)aPath;
42
43 // Acquiring a lock
44 - (BOOL)tryLock;
45
46 // Relinquishing a lock
47 - (void)breakLock;
48 - (void)unlock;
49
50 // Getting lock information
51 - (NSDate *)lockDate;
52
53 @end /* NSDistributedLock */
54
55 #endif          /* __NSDistributedLock_h__ */
56
57 /*
58   Local Variables:
59   c-basic-offset: 4
60   tab-width: 8
61   End:
62 */