mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-05 00:50:54 +00:00
Fix: _session_list in child.h must be locked
The _session_list can be modified concurrently, so the iteration over the list must be locked.
This commit is contained in:
parent
1a94c3b623
commit
4d5d91efef
@ -338,8 +338,6 @@ namespace Genode {
|
|||||||
*/
|
*/
|
||||||
void _remove_session(Session *s)
|
void _remove_session(Session *s)
|
||||||
{
|
{
|
||||||
Lock::Guard lock_guard(_lock);
|
|
||||||
|
|
||||||
/* forget about this session */
|
/* forget about this session */
|
||||||
_session_pool.remove(s);
|
_session_pool.remove(s);
|
||||||
_session_list.remove(s);
|
_session_list.remove(s);
|
||||||
@ -420,8 +418,9 @@ namespace Genode {
|
|||||||
*/
|
*/
|
||||||
void revoke_server(const Server *server)
|
void revoke_server(const Server *server)
|
||||||
{
|
{
|
||||||
while (1) {
|
Lock::Guard lock_guard(_lock);
|
||||||
|
|
||||||
|
while (1) {
|
||||||
/* search session belonging to the specified server */
|
/* search session belonging to the specified server */
|
||||||
Session *s = _session_list.first();
|
Session *s = _session_list.first();
|
||||||
for ( ; s && (s->server() != server); s = s->next());
|
for ( ; s && (s->server() != server); s = s->next());
|
||||||
@ -575,6 +574,7 @@ namespace Genode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Lock::Guard lock_guard(_lock);
|
||||||
_remove_session(s);
|
_remove_session(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user