Commit b2e57148 authored by Ondřej Kuzník's avatar Ondřej Kuzník
Browse files

Shorten to one epoch per PDU

A full read cycle can take a very long time if the limits are set too
high.
parent b49f5187
......@@ -128,6 +128,11 @@ handle_pdus( void *ctx, void *arg )
}
break;
}
assert( IS_ALIVE( c, c_refcnt ) );
epoch_leave( epoch );
epoch = epoch_join();
assert( IS_ALIVE( c, c_refcnt ) );
}
event_add( c->c_read_event, c->c_read_timeout );
......
......@@ -132,6 +132,7 @@ int try_release_ref( uintptr_t *refp, void *object, dispose_cb *cb );
*/
#define RELEASE_REF( object, ref_field, cb ) \
do { \
assert( IS_ALIVE( (object), ref_field ) ); \
if ( !__atomic_sub_fetch( \
&(object)->ref_field, 1, __ATOMIC_ACQ_REL ) ) { \
epoch_append( object, (dispose_cb *)cb ); \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment