зеркало из https://github.com/github/ruby.git
* thread.c (rb_barrier_waiting): fix potential overflows.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
db02621bfb
Коммит
8032371462
|
@ -1,3 +1,7 @@
|
|||
Fri Jan 13 18:25:49 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* thread.c (rb_barrier_waiting): fix potential overflows.
|
||||
|
||||
Fri Jan 13 17:23:38 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* load.c (load_unlock): update loading table at once.
|
||||
|
|
6
thread.c
6
thread.c
|
@ -3687,18 +3687,18 @@ barrier_alloc(VALUE klass)
|
|||
#define GetBarrierPtr(obj) ((VALUE)rb_check_typeddata((obj), &barrier_data_type))
|
||||
#define BARRIER_WAITING_MASK (FL_USER0|FL_USER1|FL_USER2|FL_USER3|FL_USER4|FL_USER5|FL_USER6|FL_USER7|FL_USER8|FL_USER9|FL_USER10|FL_USER11|FL_USER12|FL_USER13|FL_USER14|FL_USER15|FL_USER16|FL_USER17|FL_USER18|FL_USER19)
|
||||
#define BARRIER_WAITING_SHIFT (FL_USHIFT)
|
||||
#define rb_barrier_waiting(b) ((RBASIC(b)->flags&BARRIER_WAITING_MASK)>>BARRIER_WAITING_SHIFT)
|
||||
#define rb_barrier_waiting(b) (int)((RBASIC(b)->flags&BARRIER_WAITING_MASK)>>BARRIER_WAITING_SHIFT)
|
||||
#define rb_barrier_waiting_inc(b) do { \
|
||||
int w = rb_barrier_waiting(b); \
|
||||
w++; \
|
||||
RBASIC(b)->flags &= ~BARRIER_WAITING_MASK; \
|
||||
RBASIC(b)->flags |= (w << BARRIER_WAITING_SHIFT); \
|
||||
RBASIC(b)->flags |= ((VALUE)w << BARRIER_WAITING_SHIFT); \
|
||||
} while (0)
|
||||
#define rb_barrier_waiting_dec(b) do { \
|
||||
int w = rb_barrier_waiting(b); \
|
||||
w--; \
|
||||
RBASIC(b)->flags &= ~BARRIER_WAITING_MASK; \
|
||||
RBASIC(b)->flags |= (w << BARRIER_WAITING_SHIFT); \
|
||||
RBASIC(b)->flags |= ((VALUE)w << BARRIER_WAITING_SHIFT); \
|
||||
} while (0)
|
||||
|
||||
VALUE
|
||||
|
|
Загрузка…
Ссылка в новой задаче