* The net_domain's lock is now a recursive lock.
* Fixed all route locking problems, of which there were numerous
({add|remove}_route(), and list_routes() did not lock at all). Added
lock assertions in functions that don't do the locking themselves.
* A route will now be removed from the list in remove_route(), not in
put_route_internal(). Before, a route could easily be removed twice, causing
remove_route() to release references it did not own. This fixes bug #2706.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29386 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -327,7 +327,7 @@ put_interface(struct net_interface_private* interface)
|
||||
{
|
||||
// TODO: reference counting
|
||||
// TODO: better locking scheme
|
||||
mutex_unlock(&((net_domain_private*)interface->domain)->lock);
|
||||
recursive_lock_unlock(&((net_domain_private*)interface->domain)->lock);
|
||||
}
|
||||
|
||||
|
||||
@@ -335,7 +335,7 @@ struct net_interface_private*
|
||||
get_interface(net_domain* _domain, const char* name)
|
||||
{
|
||||
net_domain_private* domain = (net_domain_private*)_domain;
|
||||
mutex_lock(&domain->lock);
|
||||
recursive_lock_lock(&domain->lock);
|
||||
|
||||
net_interface_private* interface = NULL;
|
||||
while (true) {
|
||||
@@ -344,11 +344,12 @@ get_interface(net_domain* _domain, const char* name)
|
||||
if (interface == NULL)
|
||||
break;
|
||||
|
||||
// TODO: We keep the domain locked for now
|
||||
if (!strcmp(interface->name, name))
|
||||
return interface;
|
||||
}
|
||||
|
||||
mutex_unlock(&domain->lock);
|
||||
recursive_lock_unlock(&domain->lock);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user