diff options
author | Evgeniy Dushistov <dushistov@mail.ru> | 2014-11-07 16:12:58 -0800 |
---|---|---|
committer | Cary Coutant <ccoutant@google.com> | 2014-11-07 16:12:58 -0800 |
commit | d37ffe2537a2ec5a22abfaad316a640a40cccda1 (patch) | |
tree | 98f069f1e66350e7afa5383a91ecc46a667c1d6a /gold/plugin.h | |
parent | 8ee35f2ab5f91c7a558009ff9ba341dc7133ef4c (diff) | |
download | binutils-d37ffe2537a2ec5a22abfaad316a640a40cccda1.zip binutils-d37ffe2537a2ec5a22abfaad316a640a40cccda1.tar.gz binutils-d37ffe2537a2ec5a22abfaad316a640a40cccda1.tar.bz2 |
Fix race condition when using --threads with linker plugins.
2014-11-06 Evgeniy Dushistov <dushistov@mail.ru>
gold/
* plugin.cc: use lock to searialize calls of Plugin_manager::claim_file
* plugin.h: add lock definition
Diffstat (limited to 'gold/plugin.h')
-rw-r--r-- | gold/plugin.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gold/plugin.h b/gold/plugin.h index 9ef2812..f27f98d 100644 --- a/gold/plugin.h +++ b/gold/plugin.h @@ -134,7 +134,8 @@ class Plugin_manager in_claim_file_handler_(false), options_(options), workqueue_(NULL), task_(NULL), input_objects_(NULL), symtab_(NULL), layout_(NULL), dirpath_(NULL), mapfile_(NULL), - this_blocker_(NULL), extra_search_path_() + this_blocker_(NULL), extra_search_path_(), lock_(NULL), + initialize_lock_(&lock_) { this->current_ = plugins_.end(); } ~Plugin_manager(); @@ -376,6 +377,8 @@ class Plugin_manager // An extra directory to seach for the libraries passed by // add_input_library. std::string extra_search_path_; + Lock* lock_; + Initialize_lock initialize_lock_; }; |