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:
rfm 2008-09-27 05:54:27 +00:00
parent 342f03bc84
commit 6c64292edc

View file

@ -100,7 +100,8 @@ objc_sync_find_node(id obj)
/**
* 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;
@ -218,11 +219,11 @@ objc_sync_enter(id obj)
}
}
status = objc_mutex_lock(node->lock);
// unlock the table....
objc_mutex_unlock(table_lock);
status = objc_mutex_lock(node->lock);
// if the status is more than one, then another thread
// has this section locked, so we abort. A status of -1
// indicates that an error occurred.