提交 fb7e52f7 编写于 作者: H Hongze Cheng

make it compile

上级 9e90dcc5
......@@ -35,6 +35,10 @@ struct SPgHdr {
SPgHdr *pFreeNext;
};
static void tdbPCacheLock(SPCache *pCache);
static void tdbPCacheUnlock(SPCache *pCache);
static bool tdbPCacheLocked(SPCache *pCache);
int tdbOpenPCache(int pageSize, int cacheSize, int extraSize, SPCache **ppCache) {
SPCache *pCache;
void * pPtr;
......@@ -68,6 +72,27 @@ int tdbOpenPCache(int pageSize, int cacheSize, int extraSize, SPCache **ppCache)
}
int tdbClosePCache(SPCache *pCache) {
// TODO
/* TODO */
return 0;
}
void *tdbPCacheFetch(SPCache *pCache, SPgid *pPgid) {
tdbPCacheLock(pCache);
// 1. search the hash table
tdbPCacheUnlock(pCache);
return NULL;
}
void tdbPCacheRelease(void *pHdr) {
// TODO
}
static void tdbPCacheLock(SPCache *pCache) { pthread_mutex_lock(&(pCache->mutex)); }
static void tdbPCacheUnlock(SPCache *pCache) { pthread_mutex_unlock(&(pCache->mutex)); }
static bool tdbPCacheLocked(SPCache *pCache) {
assert(0);
// TODO
return true;
}
\ No newline at end of file
......@@ -25,7 +25,8 @@ typedef struct SPgHdr SPgHdr;
int tdbOpenPCache(int pageSize, int cacheSize, int extraSize, SPCache **ppCache);
int tdbPCacheClose(SPCache *pCache);
void *tdbPCacheFetch(SPCache *pCache);
void *tdbPCacheFetch(SPCache *pCache, SPgid *pPgid);
void tdbPCacheRelease(void *pHdr);
#ifdef __cplusplus
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册