Commit Graph

6 Commits

Author SHA1 Message Date
Russell Belfer
19b9a09209 Add stddef include for sortedcache
All use of sortedcache will need this header, so put it in the
definition of the sortedcache API.
2013-08-28 11:20:47 -07:00
Russell Belfer
805755f49b Fix sortedcache docs and other feedback
This converts an internal lock from a write lock to a read lock
where write isn't needed, and also clarifies some doc things about
where various locks are acquired and how various APIs are intended
to be used.
2013-08-22 15:44:34 -07:00
Russell Belfer
8d9a85d43a Convert sortedcache to use rwlock
This is the first use we have of pthread_rwlock_t in libgit2.
Hopefully it won't cause any serious portability problems.
2013-08-22 11:40:53 -07:00
Russell Belfer
3eecadcce5 Improve comments on locking for sortedcache APIs 2013-08-21 22:50:37 -07:00
Russell Belfer
a4977169e1 Add sortedcache APIs to lookup index and remove
This adds two other APIs that I need to the sortedcache type.
2013-08-21 14:09:38 -07:00
Russell Belfer
0b7cdc0263 Add sorted cache data type
This adds a convenient new data type for caching the contents of
file in memory when each item in that file corresponds to a name
and you need to both be able to lookup items by name and iterate
over them in some sorted order.  The new data type has locks in
place to manage usage in a threaded environment.
2013-08-20 16:14:24 -07:00