@@ -180,8 +180,7 @@ class MemoryHeader
180
180
#define USE_FCNTL
181
181
#endif
182
182
183
- class CountedFd ;
184
- class CountedRWLock ;
183
+ class SharedFileInfo ;
185
184
186
185
class FileLock
187
186
{
@@ -191,8 +190,8 @@ class FileLock
191
190
enum LockMode {FLM_EXCLUSIVE, FLM_TRY_EXCLUSIVE, FLM_SHARED};
192
191
193
192
typedef void InitFunction (int fd);
194
- explicit FileLock ( const char * fileName, InitFunction* init = NULL ); // main ctor
195
- FileLock (const FileLock* main, int s); // creates additional lock for existing file
193
+
194
+ explicit FileLock (const char * fileName, InitFunction* init = NULL );
196
195
~FileLock ();
197
196
198
197
// Main function to lock file
@@ -201,24 +200,18 @@ class FileLock
201
200
// Alternative locker is using status vector to report errors
202
201
bool setlock (Firebird::CheckStatusWrapper* status, const LockMode mode);
203
202
204
- // unlocking can only put error into log file - we can't throw in dtors
203
+ // Unlocking can only put error into log file - we can't throw in dtors
205
204
void unlock ();
206
205
206
+ // Obvious access to file descriptor
207
207
int getFd ();
208
208
209
- private:
210
209
enum LockLevel {LCK_NONE, LCK_SHARED, LCK_EXCL};
211
210
211
+ private:
212
+ Firebird::RefPtr<SharedFileInfo> file;
213
+ InitFunction* initFunction;
212
214
LockLevel level;
213
- CountedFd* oFile;
214
- #ifdef USE_FCNTL
215
- int lStart;
216
- #endif
217
- class CountedRWLock * rwcl; // Due to order of init in ctor rwcl must go after fd & start
218
-
219
- Firebird::string getLockId ();
220
- class CountedRWLock * getRw ();
221
- void rwUnlock ();
222
215
};
223
216
224
217
#endif // UNIX
0 commit comments