Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group lock and other foundation in PJLIB for fixing synchronization issues #1616

Closed
pjsipbot opened this issue Feb 13, 2013 · 0 comments
Closed

Comments

@pjsipbot
Copy link
Collaborator

2013-02-13 07:58:29: @bennylp created the issue on trac ticket 1616

This ticket contains works to be/that have been done in PJLIB to lay foundation for fixing various synchronization issues in upper layers such as PJNATH (see #1617). The details of the work are as follow.

-Group Lock*

Implement Group Lock, a new synchronization object for dealing with deadlock and session management. Please see the link for more info.

-More robust timer heap*

  • Integration of group lock to the timer heap. A new API is introduced: pj_timer_heap_schedule_w_grp_lock(), which adds reference counter to the group lock when timer is scheduled, and automatically decrements it after the timer expires or cancelled, to prevent the group lock from being destroyed when a timer callback is about to be executed. This API also sets the timer "id" automatically and atomically.
  • New convenience API: pj_timer_heap_cancel_if_active() to cancel a timer without having to firstly check if it is active or not.

-Changes is ioqueue and active socket*

  • New API pj_ioqueue_register_sock2() that takes group lock argument. The group lock would be incremented before callback is called to prevent it from being destroyed while callback is about to run.
  • Added grp_lock in pj_activesock_cfg, to specify which group lock to use by the ioqueue key.

-Miscellaneous*

  • New PJ_EGONE error code. It is used when pj_grp_lock_dec_ref() or pj_grp_lock_release() causes the group lock to be destroyed.
  • New PJ_RACE_ME(x) macro which can be inserted in various strategic locations. During testing, the macro can be replaced with pj_thread_sleep(x) in order to trigger race condition to happen.
  • Event object (similar to Windows event) implementation for os_core_unix.c based on Pthread condition variable. This is used by the pjnath-test testing program to synchronize the tests.

2013-02-13 08:00:45: @bennylp edited the issue description


2013-02-21 11:18:38: @bennylp changed status from new to closed


2013-02-21 11:18:38: @bennylp set resolution to fixed


2013-02-21 11:18:38: @bennylp commented

In r4359:
Fixed #1616: Implementation of Group lock and other foundation in PJLIB for fixing synchronization issues


2013-02-21 11:24:14: @bennylp edited the issue description


2013-02-21 11:51:37: @bennylp edited the issue description


2013-02-27 07:15:59: @trengginas commented

In r4374:
Re #1616: symbian port of ioqueue & timer


2013-03-05 06:29:16: @mingteluu commented

In r4413:
Re #1616: Fixed assertion trying to release group lock when STUN transaction is already destroyed in the callback


2013-03-08 01:25:49: @bennylp commented

Replying to [comment:6 ming]:

In r4413:

> Re #1616: Fixed assertion trying to release group lock when STUN transaction is already destroyed in the callback

This changeset belongs to #1617 instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants