Replace assert with RUBY_ASSERT in thread_sync.c
assert does not print the bug report, only the file and line number of the assertion that failed. RUBY_ASSERT prints the full bug report, which makes it much easier to debug.
This commit is contained in:
parent
9a2b692249
commit
80700f453e
@ -854,7 +854,7 @@ raise_closed_queue_error(VALUE self)
|
|||||||
static VALUE
|
static VALUE
|
||||||
queue_closed_result(VALUE self, struct rb_queue *q)
|
queue_closed_result(VALUE self, struct rb_queue *q)
|
||||||
{
|
{
|
||||||
assert(queue_length(self, q) == 0);
|
RUBY_ASSERT(queue_length(self, q) == 0);
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1081,8 +1081,8 @@ queue_do_pop(VALUE self, struct rb_queue *q, int should_block, VALUE timeout)
|
|||||||
else {
|
else {
|
||||||
rb_execution_context_t *ec = GET_EC();
|
rb_execution_context_t *ec = GET_EC();
|
||||||
|
|
||||||
assert(RARRAY_LEN(q->que) == 0);
|
RUBY_ASSERT(RARRAY_LEN(q->que) == 0);
|
||||||
assert(queue_closed_p(self) == 0);
|
RUBY_ASSERT(queue_closed_p(self) == 0);
|
||||||
|
|
||||||
struct queue_waiter queue_waiter = {
|
struct queue_waiter queue_waiter = {
|
||||||
.w = {.self = self, .th = ec->thread_ptr, .fiber = nonblocking_fiber(ec->fiber_ptr)},
|
.w = {.self = self, .th = ec->thread_ptr, .fiber = nonblocking_fiber(ec->fiber_ptr)},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user