mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
don't block entire data structure while locking node
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26884 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b6b08ef59b
commit
78ea2c04a3
1 changed files with 4 additions and 3 deletions
|
@ -100,7 +100,8 @@ objc_sync_find_node(id obj)
|
||||||
/**
|
/**
|
||||||
* Add a node for the object, if one doesn't already exist.
|
* Add a node for the object, if one doesn't already exist.
|
||||||
*/
|
*/
|
||||||
lock_node_t* objc_sync_add_node(id obj)
|
lock_node_t*
|
||||||
|
objc_sync_add_node(id obj)
|
||||||
{
|
{
|
||||||
lock_node_t *current = NULL;
|
lock_node_t *current = NULL;
|
||||||
|
|
||||||
|
@ -218,11 +219,11 @@ objc_sync_enter(id obj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
status = objc_mutex_lock(node->lock);
|
|
||||||
|
|
||||||
// unlock the table....
|
// unlock the table....
|
||||||
objc_mutex_unlock(table_lock);
|
objc_mutex_unlock(table_lock);
|
||||||
|
|
||||||
|
status = objc_mutex_lock(node->lock);
|
||||||
|
|
||||||
// if the status is more than one, then another thread
|
// if the status is more than one, then another thread
|
||||||
// has this section locked, so we abort. A status of -1
|
// has this section locked, so we abort. A status of -1
|
||||||
// indicates that an error occurred.
|
// indicates that an error occurred.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue