Moved runtime.LockOSThread() to urtrator.go.

This commit is contained in:
2016-11-21 01:33:04 +05:00
parent 57a5f7cb4c
commit 0392f510f5
4 changed files with 1 additions and 17 deletions

View File

@@ -14,7 +14,6 @@ import (
//"database/sql"
"fmt"
"path"
"runtime"
"strconv"
// local
@@ -49,12 +48,10 @@ func (d *Database) Close() {
tx.Commit()
d.Db.Close()
runtime.UnlockOSThread()
}
func (d *Database) Initialize(cfg *configuration.Config) {
fmt.Println("Initializing database...")
runtime.LockOSThread()
// Connect to database.
db_path := path.Join(cfg.TEMP["DATA"], "database.sqlite3")
@@ -75,10 +72,6 @@ func (d *Database) Initialize(cfg *configuration.Config) {
}
}
func (d *Database) Lock() {
runtime.LockOSThread()
}
func (d *Database) Migrate() {
// Getting current database version.
dbver := 0
@@ -94,7 +87,3 @@ func (d *Database) Migrate() {
migrate_full(d, dbver)
}
func (d *Database) Unlock() {
runtime.UnlockOSThread()
}