Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
723515cd
Commit
723515cd
authored
Jun 19, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use vlc_mutex_locker
parent
bbbd014a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
48 deletions
+5
-48
modules/services_discovery/upnp_intel.cpp
modules/services_discovery/upnp_intel.cpp
+5
-5
modules/services_discovery/upnp_intel.hpp
modules/services_discovery/upnp_intel.hpp
+0
-43
No files found.
modules/services_discovery/upnp_intel.cpp
View file @
723515cd
...
@@ -49,7 +49,7 @@ struct services_discovery_sys_t
...
@@ -49,7 +49,7 @@ struct services_discovery_sys_t
{
{
UpnpClient_Handle
clientHandle
;
UpnpClient_Handle
clientHandle
;
MediaServerList
*
serverList
;
MediaServerList
*
serverList
;
Lockable
*
callbackLock
;
vlc_mutex_t
callbackLock
;
};
};
// VLC callback prototypes
// VLC callback prototypes
...
@@ -99,7 +99,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -99,7 +99,7 @@ static int Open( vlc_object_t *p_this )
}
}
p_sys
->
serverList
=
new
MediaServerList
(
p_sd
);
p_sys
->
serverList
=
new
MediaServerList
(
p_sd
);
p_sys
->
callbackLock
=
new
Lockable
(
);
vlc_mutex_init
(
&
p_sys
->
callbackLock
);
res
=
UpnpRegisterClient
(
Callback
,
p_sd
,
&
p_sys
->
clientHandle
);
res
=
UpnpRegisterClient
(
Callback
,
p_sd
,
&
p_sys
->
clientHandle
);
if
(
res
!=
UPNP_E_SUCCESS
)
if
(
res
!=
UPNP_E_SUCCESS
)
...
@@ -128,7 +128,7 @@ static void Close( vlc_object_t *p_this )
...
@@ -128,7 +128,7 @@ static void Close( vlc_object_t *p_this )
UpnpFinish
();
UpnpFinish
();
delete
p_sd
->
p_sys
->
serverList
;
delete
p_sd
->
p_sys
->
serverList
;
delete
p_sd
->
p_sys
->
callbackLock
;
vlc_mutex_destroy
(
&
p_sd
->
p_sys
->
callbackLock
)
;
free
(
p_sd
->
p_sys
);
free
(
p_sd
->
p_sys
);
}
}
...
@@ -194,7 +194,7 @@ static int Callback( Upnp_EventType eventType, void* event, void* user_data )
...
@@ -194,7 +194,7 @@ static int Callback( Upnp_EventType eventType, void* event, void* user_data )
{
{
services_discovery_t
*
p_sd
=
(
services_discovery_t
*
)
user_data
;
services_discovery_t
*
p_sd
=
(
services_discovery_t
*
)
user_data
;
services_discovery_sys_t
*
p_sys
=
p_sd
->
p_sys
;
services_discovery_sys_t
*
p_sys
=
p_sd
->
p_sys
;
Locker
locker
(
p_sys
->
callbackLock
);
vlc_mutex_locker
locker
(
&
p_sys
->
callbackLock
);
switch
(
eventType
)
{
switch
(
eventType
)
{
...
...
modules/services_discovery/upnp_intel.hpp
View file @
723515cd
...
@@ -36,49 +36,6 @@
...
@@ -36,49 +36,6 @@
// Classes
// Classes
class
Container
;
class
Container
;
class
Lockable
{
public:
Lockable
()
{
vlc_mutex_init
(
&
_mutex
);
}
~
Lockable
()
{
vlc_mutex_destroy
(
&
_mutex
);
}
void
lock
()
{
vlc_mutex_lock
(
&
_mutex
);
}
void
unlock
()
{
vlc_mutex_unlock
(
&
_mutex
);
}
private:
vlc_mutex_t
_mutex
;
};
class
Locker
{
public:
Locker
(
Lockable
*
l
)
{
_lockable
=
l
;
_lockable
->
lock
();
}
~
Locker
()
{
_lockable
->
unlock
();
}
private:
Lockable
*
_lockable
;
};
class
MediaServer
class
MediaServer
{
{
public:
public:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment