The Pedigree Project
0.1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
src
modules
system
vfs
LockedFile.h
1
/*
2
* Copyright (c) 2008-2014, Pedigree Developers
3
*
4
* Please see the CONTRIB file in the root of the source tree for a full
5
* list of contributors.
6
*
7
* Permission to use, copy, modify, and distribute this software for any
8
* purpose with or without fee is hereby granted, provided that the above
9
* copyright notice and this permission notice appear in all copies.
10
*
11
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
*/
19
20
#ifndef LOCKED_FILE_H
21
#define LOCKED_FILE_H
22
23
#include "pedigree/kernel/process/Mutex.h"
24
#include "pedigree/kernel/processor/types.h"
25
26
class
File
;
27
32
class
LockedFile
33
{
34
public
:
36
LockedFile
(
File
*pFile);
37
39
LockedFile
(
LockedFile
&c);
40
42
LockedFile
&
operator=
(
const
LockedFile
&c);
44
46
bool
lock
(
bool
bBlock =
false
);
47
49
void
unlock
();
50
55
File
*
getFile
();
56
58
size_t
getLocker
();
59
60
private
:
62
LockedFile
();
63
67
File
*
m_File
;
68
70
bool
m_bLocked
;
71
73
size_t
m_LockerPid
;
74
76
#ifdef THREADS
77
Mutex
m_Lock
;
78
#endif
79
};
80
81
#endif
LockedFile::m_File
File * m_File
Definition:
LockedFile.h:67
LockedFile
Definition:
LockedFile.h:32
Mutex
Definition:
Mutex.h:58
LockedFile::getLocker
size_t getLocker()
Definition:
LockedFile.cc:101
LockedFile::m_LockerPid
size_t m_LockerPid
Definition:
LockedFile.h:73
LockedFile::getFile
File * getFile()
Definition:
LockedFile.cc:87
LockedFile::lock
bool lock(bool bBlock=false)
Definition:
LockedFile.cc:55
LockedFile::m_Lock
Mutex m_Lock
Definition:
LockedFile.h:77
LockedFile::LockedFile
LockedFile()
LockedFile::operator=
LockedFile & operator=(const LockedFile &c)
LockedFile::m_bLocked
bool m_bLocked
Definition:
LockedFile.h:70
LockedFile::unlock
void unlock()
Definition:
LockedFile.cc:76
File
Definition:
File.h:66
Generated on Fri Jan 24 2020 06:46:14 for The Pedigree Project by
1.8.11