mirror of
https://git.telodendria.io/Telodendria/Cytoplasm.git
synced 2025-04-29 04:16:03 +00:00
[ADD/WIP] Start rolling in intents
This commit is contained in:
parent
20bb7a20ad
commit
3df1e4ab7b
5 changed files with 86 additions and 24 deletions
|
@ -101,7 +101,7 @@ DbFileName(FlatDb * db, Array * args)
|
|||
}
|
||||
|
||||
static DbRef *
|
||||
FlatLock(Db *d, Array *dir)
|
||||
FlatLock(Db *d, DbHint hint, Array *dir)
|
||||
{
|
||||
FlatDb *db = (FlatDb *) d;
|
||||
FlatDbRef *ref = NULL;
|
||||
|
@ -146,6 +146,8 @@ FlatLock(Db *d, Array *dir)
|
|||
|
||||
ref = Malloc(sizeof(*ref));
|
||||
DbRefInit(d, (DbRef *) ref);
|
||||
/* TODO: Hints */
|
||||
ref->base.hint = hint;
|
||||
ref->base.ts = UtilLastModified(path);
|
||||
ref->base.json = JsonDecode(stream);
|
||||
ref->stream = stream;
|
||||
|
@ -248,7 +250,7 @@ FlatCreate(Db *d, Array *dir)
|
|||
|
||||
/* FlatLock() will lock again for us */
|
||||
pthread_mutex_unlock(&d->lock);
|
||||
ret = FlatLock(d, dir);
|
||||
ret = FlatLock(d, DB_HINT_WRITE, dir);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue