mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
thread.c: unsigned
* thread.c (rb_thread_shield_waiting_{inc,dec}): should be unsigned. int is large enough since ruby requires it to be 32bit at least. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1474cfa846
commit
8a995a56c7
1 changed files with 3 additions and 3 deletions
6
thread.c
6
thread.c
|
@ -3727,9 +3727,9 @@ thread_shield_alloc(VALUE klass)
|
|||
static inline void
|
||||
rb_thread_shield_waiting_inc(VALUE b)
|
||||
{
|
||||
int w = rb_thread_shield_waiting(b);
|
||||
unsigned int w = rb_thread_shield_waiting(b);
|
||||
w++;
|
||||
if (w > (THREAD_SHIELD_WAITING_MASK>>THREAD_SHIELD_WAITING_SHIFT))
|
||||
if (w > (unsigned int)(THREAD_SHIELD_WAITING_MASK>>THREAD_SHIELD_WAITING_SHIFT))
|
||||
rb_raise(rb_eRuntimeError, "waiting count overflow");
|
||||
RBASIC(b)->flags &= ~THREAD_SHIELD_WAITING_MASK;
|
||||
RBASIC(b)->flags |= ((VALUE)w << THREAD_SHIELD_WAITING_SHIFT);
|
||||
|
@ -3738,7 +3738,7 @@ rb_thread_shield_waiting_inc(VALUE b)
|
|||
static inline void
|
||||
rb_thread_shield_waiting_dec(VALUE b)
|
||||
{
|
||||
int w = rb_thread_shield_waiting(b);
|
||||
unsigned int w = rb_thread_shield_waiting(b);
|
||||
if (!w) rb_raise(rb_eRuntimeError, "waiting count underflow");
|
||||
w--;
|
||||
RBASIC(b)->flags &= ~THREAD_SHIELD_WAITING_MASK;
|
||||
|
|
Loading…
Reference in a new issue