Changeset 1790 for pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c
- Timestamp:
- Feb 13, 2008 4:59:29 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c
r1763 r1790 320 320 goto on_error; 321 321 322 /* Disallow concurrency so that detach() and destroy() are 323 * synchronized with the callback. 324 */ 325 status = pj_ioqueue_set_concurrency(tp->rtp_key, PJ_FALSE); 326 if (status != PJ_SUCCESS) 327 goto on_error; 328 322 329 pj_ioqueue_op_key_init(&tp->rtp_read_op, sizeof(tp->rtp_read_op)); 323 330 for (i=0; i<PJ_ARRAY_SIZE(tp->rtp_pending_write); ++i) … … 344 351 goto on_error; 345 352 353 status = pj_ioqueue_set_concurrency(tp->rtcp_key, PJ_FALSE); 354 if (status != PJ_SUCCESS) 355 goto on_error; 356 346 357 pj_ioqueue_op_key_init(&tp->rtcp_read_op, sizeof(tp->rtcp_read_op)); 347 358 pj_ioqueue_op_key_init(&tp->rtcp_write_op, sizeof(tp->rtcp_write_op)); … … 384 395 385 396 if (udp->rtp_key) { 397 /* This will block the execution if callback is still 398 * being called. 399 */ 386 400 pj_ioqueue_unregister(udp->rtp_key); 387 401 udp->rtp_key = NULL; … … 646 660 647 661 if (udp->attached) { 662 /* Lock the ioqueue keys to make sure that callbacks are 663 * not executed. See ticket #460 for details. 664 */ 665 pj_ioqueue_lock_key(udp->rtp_key); 666 pj_ioqueue_lock_key(udp->rtcp_key); 667 648 668 /* User data is unreferenced on Release build */ 649 669 PJ_UNUSED_ARG(user_data); … … 659 679 udp->rtcp_cb = NULL; 660 680 udp->user_data = NULL; 681 682 /* Unlock keys */ 683 pj_ioqueue_unlock_key(udp->rtcp_key); 684 pj_ioqueue_unlock_key(udp->rtp_key); 661 685 } 662 686 }
Note: See TracChangeset
for help on using the changeset viewer.