Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
Icecast-Server
Commits
9253bf72
Commit
9253bf72
authored
May 01, 2005
by
Karl Heyes
Browse files
merge from branch, stats client details are not being removed when they exit
svn path=/icecast/trunk/icecast/; revision=9195
parent
acd1b8ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/stats.c
View file @
9253bf72
...
...
@@ -598,6 +598,25 @@ static void *_stats_thread(void *arg)
return
NULL
;
}
/* you must have the _stats_mutex locked here */
static
void
_unregister_listener
(
stats_event_t
**
queue
)
{
event_listener_t
**
prev
=
(
event_listener_t
**
)
&
_event_listeners
,
*
current
=
*
prev
;
while
(
current
)
{
if
(
current
->
queue
==
queue
)
{
*
prev
=
current
->
next
;
free
(
current
);
break
;
}
prev
=
&
current
->
next
;
current
=
*
prev
;
}
}
/* you must have the _stats_mutex locked here */
static
void
_register_listener
(
stats_event_t
**
queue
,
mutex_t
*
mutex
)
{
...
...
@@ -761,6 +780,8 @@ void *stats_connection(void *arg)
mutex_t
local_event_mutex
;
stats_event_t
*
event
;
INFO0
(
"stats client starting"
);
/* increment the thread count */
thread_mutex_lock
(
&
_stats_mutex
);
_stats_threads
++
;
...
...
@@ -789,12 +810,14 @@ void *stats_connection(void *arg)
thread_mutex_unlock
(
&
local_event_mutex
);
}
thread_mutex_destroy
(
&
local_event_mutex
);
thread_mutex_lock
(
&
_stats_mutex
);
_unregister_listener
(
&
local_event_queue
);
_stats_threads
--
;
thread_mutex_unlock
(
&
_stats_mutex
);
thread_mutex_destroy
(
&
local_event_mutex
);
INFO0
(
"stats client finished"
);
return
NULL
;
}
...
...
Write
Preview
Supports
Markdown
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