File: MutexLock.3cc

package info (click to toggle)
libcommoncpp2 1.0.13-5
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,740 kB
  • ctags: 2,860
  • sloc: cpp: 18,857; sh: 8,451; ansic: 1,546; makefile: 299; xml: 5
file content (53 lines) | stat: -rw-r--r-- 1,452 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
.TH "MutexLock" 3 "19 Jul 2003" "CommonC++" \" -*- nroff -*-
.ad l
.nh
.SH NAME
MutexLock \- The MutexLock class is used to protect a section of code so that at any given time only a single thread can perform the protected operation. \fBMutex\fP automatic locker for protected access. 
.SH SYNOPSIS
.br
.PP
\fC#include <thread.h>\fP
.PP
.SS "Public Methods"

.in +1c
.ti -1c
.RI "\fBMutexLock\fP (\fBMutex\fP &_mutex)"
.br
.RI "\fIAcquire the mutex.\fP"
.ti -1c
.RI "\fB~MutexLock\fP ()"
.br
.RI "\fIRelease the mutex automatically.\fP"
.in -1c
.SH "DETAILED DESCRIPTION"
.PP 
The MutexLock class is used to protect a section of code so that at any given time only a single thread can perform the protected operation. \fBMutex\fP automatic locker for protected access.
.PP
It use \fBMutex\fP to protect operation. Using this class is usefull and  exception safe.
.PP
A common use is
.PP
void func_to_protect() { MutexLock lock(mutex); ... operation ... }
.PP
NOTE: do not declare variable as 'MutexLock (mutex)', the mutex will be  released at statement end.
.PP
\fBAuthor: \fP
.in +1c
Frediano Ziglio <freddy77@angelfire.com> 
.PP
.SH "CONSTRUCTOR & DESTRUCTOR DOCUMENTATION"
.PP 
.SS "MutexLock::MutexLock (\fBMutex\fP & _mutex)\fC [inline]\fP"
.PP
Acquire the mutex.
.PP
.SS "MutexLock::~MutexLock ()\fC [inline]\fP"
.PP
Release the mutex automatically.
.PP


.SH "AUTHOR"
.PP 
Generated automatically by Doxygen for CommonC++ from the source code.