Commit a6cf5de9 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent aa23bcda
...@@ -61,9 +61,8 @@ type Connection struct { ...@@ -61,9 +61,8 @@ type Connection struct {
// //
// but does not hold strong reference to cached objects. // but does not hold strong reference to cached objects.
// //
// LiveCache is safe for multiple simultaneous read access. // LiveCache is safe to access for multiple-readers / single-writer.
// LiveCache is not safe for multiple simultaneous read/write access - // To do so the caller must explicitly serialize access with e.g. .Lock() .
// the caller must explicitly serialize access with e.g. .Lock() .
// //
// XXX try to hide locking from user? // XXX try to hide locking from user?
type LiveCache struct { type LiveCache struct {
...@@ -170,7 +169,7 @@ func (e *wrongClassError) Error() string { ...@@ -170,7 +169,7 @@ func (e *wrongClassError) Error() string {
// Get lookups object corresponding to oid in the cache. // Get lookups object corresponding to oid in the cache.
// //
// It is not safe to call Get from multiple goroutines simultaneously. // If object is found, it is guaranteed to stay in live cache while the caller keeps reference to it.
func (cache *LiveCache) Get(oid Oid) IPersistent { func (cache *LiveCache) Get(oid Oid) IPersistent {
wobj := cache.objtab[oid] wobj := cache.objtab[oid]
var obj IPersistent var obj IPersistent
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment