* This always records the maximum count, it is not decremented
* when readers release their slots.
*/
- uint32_t mtb_numreaders;
+ unsigned mtb_numreaders;
/** The ID of the most recent meta page in the database.
* This is recorded here only for convenience; the value can always
* be determined by reading the main database meta pages.
}
int
-mdb_env_set_maxreaders(MDB_env *env, int readers)
+mdb_env_set_maxreaders(MDB_env *env, unsigned int readers)
{
- if (env->me_map)
+ if (env->me_map || readers < 1)
return EINVAL;
env->me_maxreaders = readers;
return MDB_SUCCESS;
}
int
-mdb_env_get_maxreaders(MDB_env *env, int *readers)
+mdb_env_get_maxreaders(MDB_env *env, unsigned int *readers)
{
if (!env || !readers)
return EINVAL;
* <li>EINVAL - an invalid parameter was specified, or the environment is already open.
* </ul>
*/
-int mdb_env_set_maxreaders(MDB_env *env, int readers);
+int mdb_env_set_maxreaders(MDB_env *env, unsigned int readers);
/** Get the maximum number of threads for the environment.
* @param[in] env An environment handle returned by #mdb_env_create()
* <li>EINVAL - an invalid parameter was specified.
* </ul>
*/
-int mdb_env_get_maxreaders(MDB_env *env, int *readers);
+int mdb_env_get_maxreaders(MDB_env *env, unsigned int *readers);
/** Set the maximum number of databases for the environment.
* This function is only needed if multiple databases will be used in the