projects
/
sdk
/
tools
/
sdk-build.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fb722a1
)
[Title] Added thread mutex on DB access
author
donghee yang
<donghee.yang@samsung.com>
Fri, 5 Apr 2013 01:47:30 +0000
(10:47 +0900)
committer
donghee yang
<donghee.yang@samsung.com>
Fri, 5 Apr 2013 01:47:30 +0000
(10:47 +0900)
src/build_server/BuildServer.rb
patch
|
blob
|
history
diff --git
a/src/build_server/BuildServer.rb
b/src/build_server/BuildServer.rb
index c3c56eb1a8ad80c9fddb091d6bcc3e49966988f0..118775948e80431f7d3fad6b749b2f72161a113f 100644
(file)
--- a/
src/build_server/BuildServer.rb
+++ b/
src/build_server/BuildServer.rb
@@
-108,6
+108,7
@@
class BuildServer
@db_passwd = nil
@db_version = 3
@sqlite3_db_mutex = Mutex.new
+ @db_transaction_mutex = Mutex.new
#DB upgrade SQL command
@db_migrate = []
@@
-722,9
+723,11
@@
class BuildServer
@db = DBI.connect("DBI:#{@db_dsn}", @db_user, @db_passwd)
end
end
- @db['AutoCommit'] = false
- @db.transaction do |dbh|
- yield dbh if block_given?
+ @db_transaction_mutex.synchronize do
+ @db['AutoCommit'] = false
+ @db.transaction do |dbh|
+ yield dbh if block_given?
+ end
end
return true