Hatena::Grouptechmemo

msyktの日記

2011-08-13

[TCTDB]tctdbput

22:54

/* Store a record into a table database object. */
bool tctdbput(TCTDB *tdb, const void *pkbuf, int pksiz, TCMAP *cols){
  assert(tdb && pkbuf && pksiz >= 0 && cols);
  int vsiz;
  if(tcmapget(cols, "", 0, &vsiz)){
    tctdbsetecode(tdb, TCEINVALID, __FILE__, __LINE__, __func__);
    return false;  }
  if(!TDBLOCKMETHOD(tdb, true)) return false;
  if(!tdb->open || !tdb->wmode){
    tctdbsetecode(tdb, TCEINVALID, __FILE__, __LINE__, __func__);
    TDBUNLOCKMETHOD(tdb);
    return false;
  }
  bool rv = tctdbputimpl(tdb, pkbuf, pksiz, cols, TDBPDOVER);
  TDBUNLOCKMETHOD(tdb);
  return rv;
}
  1. table databaseのロックを取得
  2. tctdbputimpl
  3. table databaseのロックを解放

DenverDenver2011/11/29 14:05You really found a way to make this whole prosecs easier.

ruwxiysvruwxiysv2011/11/30 00:36TQ0a7a <a href="http://srfcwslcgnra.com/">srfcwslcgnra</a>

bkyurjuesmsbkyurjuesms2011/12/02 23:56GB3oru <a href="http://mlsskdztafdv.com/">mlsskdztafdv</a>