Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
c0688b7a
Project 'savoirfairelinux/ring-daemon' was moved to 'savoirfairelinux/jami-daemon'. Please update any links and bookmarks that may still have the old path.
Commit
c0688b7a
authored
11 years ago
by
Tristan Matthews
Browse files
Options
Downloads
Patches
Plain Diff
* #30347: call: remove ScopedLock
parent
eb78cda6
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
daemon/src/call.cpp
+8
-12
8 additions, 12 deletions
daemon/src/call.cpp
daemon/src/call.h
+2
-2
2 additions, 2 deletions
daemon/src/call.h
with
10 additions
and
14 deletions
daemon/src/call.cpp
+
8
−
12
View file @
c0688b7a
...
@@ -32,7 +32,6 @@
...
@@ -32,7 +32,6 @@
#include
"manager.h"
#include
"manager.h"
#include
"audio/mainbuffer.h"
#include
"audio/mainbuffer.h"
#include
"history/historyitem.h"
#include
"history/historyitem.h"
#include
"scoped_lock.h"
Call
::
Call
(
const
std
::
string
&
id
,
Call
::
CallType
type
,
const
std
::
string
&
accountID
)
Call
::
Call
(
const
std
::
string
&
id
,
Call
::
CallType
type
,
const
std
::
string
&
accountID
)
:
callMutex_
()
:
callMutex_
()
...
@@ -51,40 +50,37 @@ Call::Call(const std::string& id, Call::CallType type, const std::string &accoun
...
@@ -51,40 +50,37 @@ Call::Call(const std::string& id, Call::CallType type, const std::string &accoun
,
timestamp_start_
(
0
)
,
timestamp_start_
(
0
)
,
timestamp_stop_
(
0
)
,
timestamp_stop_
(
0
)
{
{
pthread_mutex_init
(
&
callMutex_
,
NULL
);
time
(
&
timestamp_start_
);
time
(
&
timestamp_start_
);
}
}
Call
::~
Call
()
Call
::~
Call
()
{
{}
pthread_mutex_destroy
(
&
callMutex_
);
}
void
void
Call
::
setConnectionState
(
ConnectionState
state
)
Call
::
setConnectionState
(
ConnectionState
state
)
{
{
s
fl
::
ScopedL
ock
m
(
callMutex_
);
s
td
::
lock_guard
<
std
::
mutex
>
l
ock
(
callMutex_
);
connectionState_
=
state
;
connectionState_
=
state
;
}
}
Call
::
ConnectionState
Call
::
ConnectionState
Call
::
getConnectionState
()
Call
::
getConnectionState
()
{
{
s
fl
::
ScopedL
ock
m
(
callMutex_
);
s
td
::
lock_guard
<
std
::
mutex
>
l
ock
(
callMutex_
);
return
connectionState_
;
return
connectionState_
;
}
}
void
void
Call
::
setState
(
CallState
state
)
Call
::
setState
(
CallState
state
)
{
{
s
fl
::
ScopedL
ock
m
(
callMutex_
);
s
td
::
lock_guard
<
std
::
mutex
>
l
ock
(
callMutex_
);
callState_
=
state
;
callState_
=
state
;
}
}
Call
::
CallState
Call
::
CallState
Call
::
getState
()
Call
::
getState
()
{
{
s
fl
::
ScopedL
ock
m
(
callMutex_
);
s
td
::
lock_guard
<
std
::
mutex
>
l
ock
(
callMutex_
);
return
callState_
;
return
callState_
;
}
}
...
@@ -129,21 +125,21 @@ Call::getStateStr()
...
@@ -129,21 +125,21 @@ Call::getStateStr()
std
::
string
std
::
string
Call
::
getLocalIp
()
Call
::
getLocalIp
()
{
{
s
fl
::
ScopedL
ock
m
(
callMutex_
);
s
td
::
lock_guard
<
std
::
mutex
>
l
ock
(
callMutex_
);
return
localIPAddress_
;
return
localIPAddress_
;
}
}
unsigned
int
unsigned
int
Call
::
getLocalAudioPort
()
Call
::
getLocalAudioPort
()
{
{
s
fl
::
ScopedL
ock
m
(
callMutex_
);
s
td
::
lock_guard
<
std
::
mutex
>
l
ock
(
callMutex_
);
return
localAudioPort_
;
return
localAudioPort_
;
}
}
unsigned
int
unsigned
int
Call
::
getLocalVideoPort
()
Call
::
getLocalVideoPort
()
{
{
s
fl
::
ScopedL
ock
m
(
callMutex_
);
s
td
::
lock_guard
<
std
::
mutex
>
l
ock
(
callMutex_
);
return
localVideoPort_
;
return
localVideoPort_
;
}
}
...
...
This diff is collapsed.
Click to expand it.
daemon/src/call.h
+
2
−
2
View file @
c0688b7a
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
#include
<sstream>
#include
<sstream>
#include
<map>
#include
<map>
#include
<
pthread.h
>
#include
<
mutex
>
#include
"audio/recordable.h"
#include
"audio/recordable.h"
/*
/*
...
@@ -233,7 +233,7 @@ class Call : public Recordable {
...
@@ -233,7 +233,7 @@ class Call : public Recordable {
private
:
private
:
std
::
string
getTypeStr
()
const
;
std
::
string
getTypeStr
()
const
;
/** Protect every attribute that can be changed by two threads */
/** Protect every attribute that can be changed by two threads */
pthread_
mutex
_t
callMutex_
;
std
::
mutex
callMutex_
;
// Informations about call socket / audio
// Informations about call socket / audio
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment