diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-09 06:48:15 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-09 06:48:15 +0000 |
commit | 0599d7de5844a2f838cdf631b9c88b05010ebe5d (patch) | |
tree | 4553ae951239a25b2d8a5bc7325e9d9e096e1e80 /regcomp.c | |
parent | e48adae2b3e7dfab79fb5a72467a559749edebd5 (diff) | |
download | ruby-0599d7de5844a2f838cdf631b9c88b05010ebe5d.tar.gz |
use atomic operations
* regcomp.c (onig_chain_link_add): use atomic operation instead of
mutex.
* regint.h (ONIG_STATE_{INC,DEC}_THREAD): ditto.
* regparse.c (PopFreeNode, node_recycle): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -5663,10 +5663,11 @@ onig_transfer(regex_t* to, regex_t* from) extern void onig_chain_link_add(regex_t* to, regex_t* add) { - THREAD_ATOMIC_START; - REGEX_CHAIN_HEAD(to); - to->chain = add; - THREAD_ATOMIC_END; + /* THREAD_ATOMIC_START; */ + do { + REGEX_CHAIN_HEAD(to); + } while (IS_NOT_NULL(ATOMIC_PTR_CAS(to->chain, (regex_t* )NULL, add))); + /* THREAD_ATOMIC_END; */ } extern void |