1
1

Atomically increase the size of the req_bytes_sent.

Decrease and limit the locked part of the function.

This commit was SVN r3638.
Этот коммит содержится в:
George Bosilca 2004-11-19 21:33:25 +00:00
родитель 5c17dfda0e
Коммит 1dfcf38d3c

Просмотреть файл

@ -150,8 +150,8 @@ void mca_pml_teg_send_request_progress(
size_t bytes_sent)
{
bool schedule = false;
OMPI_THREAD_LOCK(&ompi_request_lock);
req->req_bytes_sent += bytes_sent;
ompi_atomic_add( &(req->req_bytes_sent), bytes_sent );
if (req->req_bytes_sent >= req->req_bytes_packed) {
req->req_base.req_pml_complete = true;
if (req->req_base.req_ompi.req_complete == false) {
@ -161,7 +161,9 @@ void mca_pml_teg_send_request_progress(
req->req_base.req_ompi.req_status._count = req->req_bytes_sent;
req->req_base.req_ompi.req_complete = true;
if(ompi_request_waiting) {
OMPI_THREAD_LOCK(&ompi_request_lock);
ompi_condition_broadcast(&ompi_request_cond);
OMPI_THREAD_UNLOCK(&ompi_request_lock);
}
} else if (req->req_base.req_free_called) {
MCA_PML_TEG_FREE((ompi_request_t**)&req);
@ -169,7 +171,6 @@ void mca_pml_teg_send_request_progress(
/* test to see if we have scheduled the entire request */
} else if (req->req_offset < req->req_bytes_packed)
schedule = true;
OMPI_THREAD_UNLOCK(&ompi_request_lock);
/* schedule remaining fragments of this request */
if(schedule) {