24 pthread_mutex_destroy(&
mapLock);
29 if (pthread_mutex_init(&
mapLock,NULL) != 0)
return false;
30 for (
int ctx = 1; ctx <=
maxComt; ctx++) {
32 if (pthread_cond_init(&
cvec[ctx].busyCond,NULL) != 0)
49 while (
cvec[ctx].busyBit) {
65 pthread_cond_signal(&
cvec[ctx].busyCond);
77 while (
cvec[ctx].busyBit) {
81 pthread_cond_signal(&
cvec[ctx].busyCond);
99 int nuCtx =
comtMap->nextId(ctx);
102 pthread_cond_signal(&
cvec[ctx].busyCond);
106 while (
cvec[nuCtx].busyBit) {
111 pthread_cond_signal(&
cvec[ctx].busyCond);
112 pthread_cond_signal(&
cvec[nuCtx].busyCond);
119 pthread_cond_signal(&
cvec[ctx].busyCond);
137 if (ctx == 0) ctx =
comtMap->addPair(
key(comt));
143 cvec[ctx].comt = comt;
157 pthread_cond_signal(&
cvec[ctx].busyCond);
169 comt_t comt,
string owner, pwd, cfgString, axsString;
171 int repInterval; time_t start;
177 if (!in.good())
return false;
206 Forest::ConfigMode cfg;
207 if (cfgString ==
"static") cfg = STATIC;
208 else if (cfgString ==
"leafAdjust") cfg = LEAFADJUST;
209 else if (cfgString ==
"stepAdjust") cfg = STEPADJUST;
213 if (axsString ==
"open") axs = OPEN;
214 else if (axsString ==
"byPermission") axs = BYPERMISSION;
215 else if (axsString ==
"byPassword") axs = BYPASSWORD;
220 setRootZip(ctx,rootZip);
setSuper(ctx,super);
222 setPassword(ctx,password);
223 setReportInterval(ctx) = repInterval;
setStartTime(ctx) = start;
242 cout <<
"read " << i <<
" client records, producing "
243 << clients->getNumIn() <<
"table entries\n";
261 case STATIC: ss <<
"static";
break;
262 case LEAFADJUST: ss <<
"leafAdjust";
break;
263 case STEPADJUST: ss <<
"stepAdjust";
break;
270 case OPEN: ss <<
"open";
break;
271 case BYPERMISSION: ss <<
"byPermission";
break;
272 case BYPASSWORD: ss <<
"byPassword";
break;
277 ss << getPassword(ctx) <<
", " << getReportInterval(ctx) <<
", "
291 s += client2string(ctx,s1);
302 out << client2string(ctx,s);