0
@@ -11,6 +11,7 @@ module Merb
0
+ @@compiler_mutex = Mutex.new
0
cattr_accessor :routes, :named_routes
0
@@ -52,13 +53,15 @@ module Merb
0
# String:: A routing lambda statement generated from the routes.
0
- @@compiled_statement = "def match(request)\n"
0
- @@compiled_statement << " params = request.params\n"
0
- @@compiled_statement << " cached_path = request.path\n cached_method = request.method.to_s\n "
0
- @@routes.each_with_index { |route, i| @@compiled_statement << route.compile(i == 0) }
0
- @@compiled_statement << " else\n [nil, {}]\n"
0
- @@compiled_statement << " end\n"
0
- @@compiled_statement << "end"
0
+ @@compiler_mutex.synchronize do
0
+ @@compiled_statement = "def match(request)\n"
0
+ @@compiled_statement << " params = request.params\n"
0
+ @@compiled_statement << " cached_path = request.path\n cached_method = request.method.to_s\n "
0
+ @@routes.each_with_index { |route, i| @@compiled_statement << route.compile(i == 0) }
0
+ @@compiled_statement << " else\n [nil, {}]\n"
0
+ @@compiled_statement << " end\n"
0
+ @@compiled_statement << "end"
0
# Defines the match function for this class based on the
Comments
No one has commented yet.