Commit 60051a1a authored by Claes Sjofors's avatar Claes Sjofors

Monotonic time used in qcom_Get() and que_Get(), and Shutdown fix for qdb lock

parent 572c35e0
...@@ -154,7 +154,7 @@ qos_WaitQue ( ...@@ -154,7 +154,7 @@ qos_WaitQue (
qdb_Unlock; qdb_Unlock;
if (tmo != qcom_cTmoEternal) { if (tmo != qcom_cTmoEternal) {
time_GetTime(&atime); time_GetTimeMonotonic(&atime);
time_MsToD(&dtime, tmo); time_MsToD(&dtime, tmo);
time_Aadd(&atime, &atime, &dtime); time_Aadd(&atime, &atime, &dtime);
atime_ts.tv_sec = atime.tv_sec; atime_ts.tv_sec = atime.tv_sec;
...@@ -248,4 +248,4 @@ qos_DeleteQlock ( ...@@ -248,4 +248,4 @@ qos_DeleteQlock (
qdb_AssumeLocked; qdb_AssumeLocked;
} }
\ No newline at end of file
...@@ -1104,6 +1104,7 @@ qdb_Put ( ...@@ -1104,6 +1104,7 @@ qdb_Put (
} }
break; break;
default: default:
qdb_Unlock;
errh_Bugcheck(QCOM__WEIRD, "unknown queue type"); errh_Bugcheck(QCOM__WEIRD, "unknown queue type");
} }
} }
...@@ -1240,6 +1241,7 @@ qdb_AddQue ( ...@@ -1240,6 +1241,7 @@ qdb_AddQue (
qp->qix = qix; qp->qix = qix;
pthread_condattr_init(&condattr); pthread_condattr_init(&condattr);
pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC);
#if !defined OS_OPENBSD #if !defined OS_OPENBSD
pthread_condattr_setpshared(&condattr, PTHREAD_PROCESS_SHARED); pthread_condattr_setpshared(&condattr, PTHREAD_PROCESS_SHARED);
#endif #endif
...@@ -1562,4 +1564,4 @@ qdb_Wait ( ...@@ -1562,4 +1564,4 @@ qdb_Wait (
pool_QinsertPred(NULL, &qdb->pool, &qp->eve_ll, &ep->eve_lh); pool_QinsertPred(NULL, &qdb->pool, &qp->eve_ll, &ep->eve_lh);
return qos_WaitQue(sts, qp, tmo); return qos_WaitQue(sts, qp, tmo);
} }
\ No newline at end of file
...@@ -60,6 +60,7 @@ thread_CondInit ( ...@@ -60,6 +60,7 @@ thread_CondInit (
#elif defined OS_POSIX #elif defined OS_POSIX
pthread_condattr_t attr; pthread_condattr_t attr;
pthread_condattr_init(&attr); pthread_condattr_init(&attr);
pthread_condattr_setclock(&attr, CLOCK_MONOTONIC);
return errno_Status(pthread_cond_init(&cp->c, &attr)); return errno_Status(pthread_cond_init(&cp->c, &attr));
#else #else
# error Not defined for this platform ! # error Not defined for this platform !
...@@ -204,7 +205,7 @@ thread_CondTimedWait ( ...@@ -204,7 +205,7 @@ thread_CondTimedWait (
if (time == NULL || time->tv_sec > 100000000) if (time == NULL || time->tv_sec > 100000000)
return thread_CondWait(cp, mp); return thread_CondWait(cp, mp);
time_GetTime(&now); time_GetTimeMonotonic(&now);
time_Aadd(&then, &now, time); time_Aadd(&then, &now, time);
then_ts.tv_sec = then.tv_sec; then_ts.tv_sec = then.tv_sec;
then_ts.tv_nsec = then.tv_nsec; then_ts.tv_nsec = then.tv_nsec;
...@@ -393,4 +394,4 @@ thread_SigTimedWait ( ...@@ -393,4 +394,4 @@ thread_SigTimedWait (
return signal; return signal;
} }
#endif #endif
\ No newline at end of file
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