Thread safety of on the fly attibute method defining

Is it just me or as the attribute accessor generation stuff not threadsafe?

Currently it seems to me like like the scenario could happen

- thread 1 calls foo=, hits method missing
- thread 1 checks if generated_methods is empty. It is
- thread 1 starts iterating over columns_hash and defining methods
- thread 2 calls zomg=, hits method_missing
- thread 2 checks if generated_methods is empty. It isn't because thread 1 has added at least one accessor to generated_methods, however it hasn't got as far as the zomg column
- thread 2 throws NoMethodError