Commit 07cd6e39 authored by Claes Sjofors's avatar Claes Sjofors

Qcom monitor, mutex for link sendqueue added

parent c17d981b
...@@ -197,6 +197,7 @@ struct sLink { ...@@ -197,6 +197,7 @@ struct sLink {
pwr_tDeltaTime ack_delay; pwr_tDeltaTime ack_delay;
unsigned int exp_buf_quota; unsigned int exp_buf_quota;
sIseg tmo; sIseg tmo;
thread_sMutex eseg_mutex;
}; };
...@@ -555,6 +556,7 @@ clean_insert ( ...@@ -555,6 +556,7 @@ clean_insert (
if ((!pending) && (esp->head.flags.b.first)) { if ((!pending) && (esp->head.flags.b.first)) {
thread_MutexLock(&esp->lp->eseg_mutex);
for (sp = lst_Succ(NULL, le, &se); se != le; sp = nsp) { for (sp = lst_Succ(NULL, le, &se); se != le; sp = nsp) {
li = se; li = se;
nsp = lst_Succ(NULL, se, &se); nsp = lst_Succ(NULL, se, &se);
...@@ -576,12 +578,14 @@ clean_insert ( ...@@ -576,12 +578,14 @@ clean_insert (
break; break;
} }
} }
thread_MutexUnlock(&esp->lp->eseg_mutex);
if (!esp->head.flags.b.last && first) ret_pend = TRUE; if (!esp->head.flags.b.last && first) ret_pend = TRUE;
if (!first) li = le; if (!first) li = le;
} }
else if (pending) { else if (pending) {
thread_MutexLock(&esp->lp->eseg_mutex);
for (sp = lst_Succ(NULL, le, &se); se != le; sp = nsp) { for (sp = lst_Succ(NULL, le, &se); se != le; sp = nsp) {
li = se; li = se;
nsp = lst_Succ(NULL, se, &se); nsp = lst_Succ(NULL, se, &se);
...@@ -598,6 +602,7 @@ clean_insert ( ...@@ -598,6 +602,7 @@ clean_insert (
break; break;
} }
} }
thread_MutexUnlock(&esp->lp->eseg_mutex);
if (!first) li = le; if (!first) li = le;
ret_pend = !esp->head.flags.b.last; ret_pend = !esp->head.flags.b.last;
...@@ -618,7 +623,9 @@ clean_insert ( ...@@ -618,7 +623,9 @@ clean_insert (
} }
} }
#endif #endif
thread_MutexLock(&esp->lp->eseg_mutex);
lst_InsertPred(NULL, li, &esp->c.le, esp); lst_InsertPred(NULL, li, &esp->c.le, esp);
thread_MutexUnlock(&esp->lp->eseg_mutex);
return ret_pend; return ret_pend;
...@@ -973,6 +980,7 @@ export_thread () ...@@ -973,6 +980,7 @@ export_thread ()
thread_MutexLock(&l.bcast); thread_MutexLock(&l.bcast);
thread_MutexLock(&sp->lp->eseg_mutex);
esp = sp; esp = sp;
do { do {
ssp = esp; ssp = esp;
...@@ -983,6 +991,7 @@ export_thread () ...@@ -983,6 +991,7 @@ export_thread ()
} while (ssp != esp); } while (ssp != esp);
esp = lst_Succ(NULL, &ssp->le_bcast, NULL) ; esp = lst_Succ(NULL, &ssp->le_bcast, NULL) ;
} while (esp != sp); } while (esp != sp);
thread_MutexUnlock(&sp->lp->eseg_mutex);
thread_MutexUnlock(&l.bcast); thread_MutexUnlock(&l.bcast);
} }
...@@ -1279,6 +1288,7 @@ lack ( ...@@ -1279,6 +1288,7 @@ lack (
lst_sEntry *se; lst_sEntry *se;
int diff; int diff;
sEseg *sp, *nsp; sEseg *sp, *nsp;
thread_sMutex *mx;
for (sp = lst_Succ(NULL, &lp->lh_win, &se); se != &lp->lh_win; sp = nsp) { for (sp = lst_Succ(NULL, &lp->lh_win, &se); se != &lp->lh_win; sp = nsp) {
nsp = lst_Succ(NULL, se, &se); nsp = lst_Succ(NULL, se, &se);
...@@ -1294,7 +1304,10 @@ lack ( ...@@ -1294,7 +1304,10 @@ lack (
window_remove(lp, sp); window_remove(lp, sp);
mx = &sp->lp->eseg_mutex;
thread_MutexLock(mx);
eseg_free(sp); eseg_free(sp);
thread_MutexUnlock(mx);
} else { } else {
/* This is the oldest not acked segment. */ /* This is the oldest not acked segment. */
lp->np->link.lack = sp->head.lack; lp->np->link.lack = sp->head.lack;
...@@ -1381,6 +1394,7 @@ link_disconnect ( ...@@ -1381,6 +1394,7 @@ link_disconnect (
/* Empty send list */ /* Empty send list */
thread_MutexLock(&lp->eseg_mutex);
for ( for (
sp = lst_Succ(NULL, &lp->lh_send, NULL); sp = lst_Succ(NULL, &lp->lh_send, NULL);
sp != NULL; sp != NULL;
...@@ -1400,6 +1414,7 @@ link_disconnect ( ...@@ -1400,6 +1414,7 @@ link_disconnect (
lst_Remove(NULL, &sp->c.le); lst_Remove(NULL, &sp->c.le);
eseg_free(sp); eseg_free(sp);
} }
thread_MutexUnlock(&lp->eseg_mutex);
lp->np->link.win_count = 0; lp->np->link.win_count = 0;
...@@ -1440,6 +1455,7 @@ link_purge ( ...@@ -1440,6 +1455,7 @@ link_purge (
/* Purge send list */ /* Purge send list */
int i = 0; int i = 0;
thread_MutexLock(&lp->eseg_mutex);
for ( for (
sp = lst_Succ(NULL, &lp->lh_send, NULL); sp = lst_Succ(NULL, &lp->lh_send, NULL);
sp != NULL; sp != NULL;
...@@ -1456,6 +1472,7 @@ link_purge ( ...@@ -1456,6 +1472,7 @@ link_purge (
alloc_cnt += sp->size; alloc_cnt += sp->size;
i++; i++;
} }
thread_MutexUnlock(&lp->eseg_mutex);
printf( "link_purge: %d cnt %d (%d)\n", i, lp->np->link.export_alloc_cnt, alloc_cnt); printf( "link_purge: %d cnt %d (%d)\n", i, lp->np->link.export_alloc_cnt, alloc_cnt);
lp->np->link.export_alloc_cnt = alloc_cnt; lp->np->link.export_alloc_cnt = alloc_cnt;
lp->np->link.export_purge_cnt++; lp->np->link.export_purge_cnt++;
...@@ -1693,6 +1710,7 @@ new_link ( ...@@ -1693,6 +1710,7 @@ new_link (
lp->np->link.rtt_rxmax = rtt_rxmax; lp->np->link.rtt_rxmax = rtt_rxmax;
lp->np->link.rtt_rxmin = rtt_rxmin; lp->np->link.rtt_rxmin = rtt_rxmin;
lp->tmo.c.action = eAction_tmo; lp->tmo.c.action = eAction_tmo;
sts = thread_MutexInit(&lp->eseg_mutex);
if (mp != NULL) { if (mp != NULL) {
#if defined OS_VMS #if defined OS_VMS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment