Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap-rubygem.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tasks
diff options
context:
space:
mode:
authorGleb Mazovetskiy <glex.spb@gmail.com>2016-05-17 01:18:37 +0300
committerGleb Mazovetskiy <glex.spb@gmail.com>2016-05-17 01:18:37 +0300
commite39dac2c6684e478a6ace2f50259b29dcce781ea (patch)
tree86e4f7609b84089b319f47a687184195402890aa /tasks
parenta668c2615d6decf03a697adecd0f0df5a50c3c27 (diff)
updater: fix deprecated use of Thread.exclusive
Diffstat (limited to 'tasks')
-rw-r--r--tasks/updater/network.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/tasks/updater/network.rb b/tasks/updater/network.rb
index 3625ba1..7799f95 100644
--- a/tasks/updater/network.rb
+++ b/tasks/updater/network.rb
@@ -3,6 +3,8 @@ class Updater
module Network
protected
+ WRITE_FILES_MUTEX = Mutex.new
+
def get_paths_by_type(dir, file_re, recursive = true)
get_file_paths(dir, recursive).select { |path| path =~ file_re }
end
@@ -24,7 +26,7 @@ class Updater
files.map do |name|
Thread.start {
contents[name] = open("#{path_url}/#{name}").read
- Thread.exclusive { write_cached_files path, name => contents[name] }
+ WRITE_FILES_MUTEX.synchronize { write_cached_files path, name => contents[name] }
}
end.each(&:join)
contents