Warning: session_start(): open(/var/lib/php/sessions/sess_u2iuh57o3husf0kaiqd9vi20ql, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
// Makes the Concept.Ref object unnecessary by directly
// storing the reference in a field.
// We can probably get rid of the refs field in the same go.
// Of course, backRefs are still needed.
sbool isConceptRefValid(Concept src, Concept dest) {
ret src != null && dest != null && src._concepts != null && src._concepts == dest._concepts;
}
svoid indexConceptRef(Concept src, Concept dest) {}
svoid unindexConceptRef(Concept src, Concept dest) {}
sO conceptRefMutex(Concept c) {
ret or(c._concepts, dummyMutex());
}
concept Thing {
Thing ref_ptr;
// setter
selfType ref(Thing dest) {
synchronized(conceptRefMutex(this)) {
if (ref_ptr == dest) ret;
unindexConceptRef(this, ref_ptr);
ref_ptr = thing;
indexConceptRef(this, thing);
}
this;
}
// getter. we could get rid of this by making the field
// publicly accessible, but then we run the slight chance
// of setting it without the setter inadvertently.
Thing ref() { ret ref_ptr; }
}
cprint {}