]> git.michaelhowe.org Git - packages/o/openafs.git/commit
Rx: restore thread safety to rx_NewCall
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 15 Apr 2010 03:21:37 +0000 (23:21 -0400)
committerDerrick Brashear <shadow@dementia.org>
Thu, 15 Apr 2010 17:40:04 +0000 (10:40 -0700)
commit0607e8a4a19183798c656bf29aaa3f8aa75ac078
tree255171a2cff106d1a94d6f826531e785e4bccc77
parentb2773aa121d3c1c31ac39ac652566f54cfc4bd1b
Rx: restore thread safety to rx_NewCall

Thread safety in rx_NewCall requires that only one thread be
actively allocating or recycling a call at a time.  Since we are
no longer holding the conn_call_lock across the entire transaction
we need to have another synchronization mechanism.  Add a new
rx_connection flag, RX_CONN_MAKECALL_ACTIVE, which when set indicates
that a thread is actively obtaining a call.  If any other threads
see this flag set, they will wait until being signalled that the
thread has completed its activity.

In addition, because the call->lock may be dropped when processing
rxi_ResetCall(), we must hold a reference to the call once we
begin using it.  Otherwise, the call may be garbage collected
behind our back.

Change-Id: Ie97757f812d7043203ffcaf399400789cda39da1
Reviewed-on: http://gerrit.openafs.org/1755
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/rx/rx.c
src/rx/rx.h