Commit 67141f91 by Konstantin Käfer

don't enforce SQLITE_OPEN_FULLMUTEX when mode is set

parent a5fe5d0a
...@@ -114,9 +114,11 @@ Handle<Value> Database::New(const Arguments& args) { ...@@ -114,9 +114,11 @@ Handle<Value> Database::New(const Arguments& args) {
REQUIRE_ARGUMENT_STRING(0, filename); REQUIRE_ARGUMENT_STRING(0, filename);
int pos = 1; int pos = 1;
int mode = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE; int mode;
if (args.Length() >= pos && args[pos]->IsInt32()) { if (args.Length() >= pos && args[pos]->IsInt32()) {
mode = args[pos++]->Int32Value(); mode = args[pos++]->Int32Value();
} else {
mode = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_FULLMUTEX;
} }
Local<Function> callback; Local<Function> callback;
...@@ -131,7 +133,7 @@ Handle<Value> Database::New(const Arguments& args) { ...@@ -131,7 +133,7 @@ Handle<Value> Database::New(const Arguments& args) {
args.This()->Set(String::NewSymbol("mode"), Integer::New(mode), ReadOnly); args.This()->Set(String::NewSymbol("mode"), Integer::New(mode), ReadOnly);
// Start opening the database. // Start opening the database.
OpenBaton* baton = new OpenBaton(db, callback, *filename, SQLITE_OPEN_FULLMUTEX | mode); OpenBaton* baton = new OpenBaton(db, callback, *filename, mode);
EIO_BeginOpen(baton); EIO_BeginOpen(baton);
return args.This(); return args.This();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment