public int NextTableId()
{
lock (this) {
int curCounter = currentTableId;
++currentTableId;
try {
Store.Lock();
// Update the state in the file
headerArea.Position = 8;
headerArea.WriteInt8(currentTableId);
// Check out the change
headerArea.Flush();
} finally {
Store.Unlock();
}
return curCounter;
}
}