[IBAL] Properly handle ib_sync_destroy being used as the
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 11 Sep 2006 17:09:55 +0000 (17:09 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 11 Sep 2006 17:09:55 +0000 (17:09 +0000)
callback for synchronous objects.

Originally sent by Yossi Leybovich (sleybo@mellanox.co.il),
with modifications by Fab Tillier (ftillier@silverstorm.com)

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@488 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/al/al_common.c

index 8323ec4..fbbe2e5 100644 (file)
@@ -467,7 +467,7 @@ async_destroy_obj(
        AL_ENTER( AL_DBG_AL_OBJ );\r
 \r
        if( pfn_destroy_cb == ib_sync_destroy )\r
-               sync_destroy_obj( p_obj, __sync_destroy_cb );\r
+               sync_destroy_obj( p_obj, pfn_destroy_cb );\r
        else if( destroy_obj( p_obj, pfn_destroy_cb ) )\r
                deref_al_obj( p_obj );  /* Only destroy the object once. */\r
 \r
@@ -625,7 +625,11 @@ destroy_obj(
                inc_al_obj_desc( p_obj->p_parent_obj, p_obj->desc_cnt + 1 );\r
        }\r
 \r
-       p_obj->user_destroy_cb = pfn_destroy_cb;\r
+       if( pfn_destroy_cb == ib_sync_destroy )\r
+               p_obj->user_destroy_cb = __sync_destroy_cb;\r
+       else\r
+               p_obj->user_destroy_cb = pfn_destroy_cb;\r
+\r
        AL_EXIT( AL_DBG_AL_OBJ );\r
        return TRUE;\r
 }\r