diff --git a/include/maestro/i_pool_manager_registry.h b/include/maestro/i_pool_manager_registry.h index 90452dea2c07f06c8ddc58c3845bd00820da22c3..b16e745b16fa6b8e63dc1a9d166fa02a5a6630f8 100644 --- a/include/maestro/i_pool_manager_registry.h +++ b/include/maestro/i_pool_manager_registry.h @@ -177,7 +177,6 @@ mstro_status mstro_pm_app_lookup(mstro_app_id appid, struct mstro_pm_app_registry_entry **app_entry_p); - /** A table entry for a CDO reference in the global pool. Abstract, so * that implementations of a distributed registry do not need to * change the interface */ @@ -267,6 +266,11 @@ mstro_pm_cdo_registry_withdraw(const struct mstro_cdo_id *cdoid, mstro_event continuation_event); +/* Check blocked withdraws in g_mstro_pm_withdraw_queue -- perform possible withdraws after CDO state changes*/ +mstro_status +mstro_pm__handle_withdraws(void); + + /** Check if the cdo is still in transport before disposing * return MSTRO_WOULDBLOCK if the cdo is in transport * return MSRO_OK otherwise diff --git a/maestro/pool_manager.c b/maestro/pool_manager.c index 0844deb6d4b540f319eda19e091fe211a13139bd..131c8bd9c70de7693f728b488e34a19aa3c4bfce 100644 --- a/maestro/pool_manager.c +++ b/maestro/pool_manager.c @@ -1470,6 +1470,14 @@ mstro_pm__handle_retract_phase2(mstro_event event, app_id, idstr); ); + /* piggy-back to handle any withdraws that have become possible at this point */ + s = mstro_pm__handle_withdraws(); + if(s!=MSTRO_OK) { + ERR("Failure processing withdraw-queue entries\n"); + goto BAILOUT_FREE; + } + + /* produce require:after event */ Mstro__Pool__Event ev = MSTRO__POOL__EVENT__INIT; /* serial and handle set later */