Skip to content

Commit

Permalink
Fix minor thread-safety issue on non-GVL ruby in Database#schema
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyevans committed Sep 22, 2012
1 parent 2583cf7 commit 8e99190
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/sequel/database/query.rb
Expand Up @@ -195,7 +195,9 @@ def schema(table, opts={})
opts[:schema] = sch if sch && !opts.include?(:schema)

Sequel.synchronize{@schemas.delete(quoted_name)} if opts[:reload]
return Sequel.synchronize{@schemas[quoted_name]} if @schemas[quoted_name]
if v = Sequel.synchronize{@schemas[quoted_name]}
return v
end

cols = schema_parse_table(table_name, opts)
raise(Error, 'schema parsing returned no columns, table probably doesn\'t exist') if cols.nil? || cols.empty?
Expand Down

0 comments on commit 8e99190

Please sign in to comment.