mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Revert r52995
revert slow atomic operations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
303cd88d40
commit
b3377eaa13
6 changed files with 50 additions and 80 deletions
6
regint.h
6
regint.h
|
@ -95,7 +95,6 @@
|
|||
|
||||
#ifndef RUBY_DEFINES_H
|
||||
#include "ruby/ruby.h"
|
||||
#include "ruby_atomic.h"
|
||||
#undef xmalloc
|
||||
#undef xrealloc
|
||||
#undef xcalloc
|
||||
|
@ -239,10 +238,6 @@ extern pthread_mutex_t gOnigMutex;
|
|||
#define ONIG_STATE_INC(reg) (reg)->state++
|
||||
#define ONIG_STATE_DEC(reg) (reg)->state--
|
||||
|
||||
#if SIZEOF_ATOMIC_T == SIZEOF_INT
|
||||
#define ONIG_STATE_INC_THREAD(reg) (ATOMIC_INC((reg)->state))
|
||||
#define ONIG_STATE_DEC_THREAD(reg) (ATOMIC_DEC((reg)->state))
|
||||
#else
|
||||
#define ONIG_STATE_INC_THREAD(reg) do {\
|
||||
THREAD_ATOMIC_START;\
|
||||
(reg)->state++;\
|
||||
|
@ -253,7 +248,6 @@ extern pthread_mutex_t gOnigMutex;
|
|||
(reg)->state--;\
|
||||
THREAD_ATOMIC_END;\
|
||||
} while(0)
|
||||
#endif
|
||||
#else
|
||||
#define ONIG_STATE_INC(reg) /* Nothing */
|
||||
#define ONIG_STATE_DEC(reg) /* Nothing */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue