mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-12-27 15:14:25 +01:00
Now using the gettid() syscall to get a thread's pid, so that we get a useful value on NPTL systems
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Parts of this file were inspired by the 'ringbuffy.c' from the
|
||||
* LinuxDVB driver (see linuxtv.org).
|
||||
*
|
||||
* $Id: ringbuffer.c 1.21 2004/10/15 13:49:25 kls Exp $
|
||||
* $Id: ringbuffer.c 1.22 2005/12/10 10:55:26 kls Exp $
|
||||
*/
|
||||
|
||||
#include "ringbuffer.h"
|
||||
@@ -46,7 +46,7 @@ void cRingBuffer::UpdatePercentage(int Fill)
|
||||
int percent = Fill * 100 / (Size() - 1) / PERCENTAGEDELTA * PERCENTAGEDELTA;
|
||||
if (percent != lastPercent) {
|
||||
if (percent >= PERCENTAGETHRESHOLD && percent > lastPercent || percent < PERCENTAGETHRESHOLD && lastPercent >= PERCENTAGETHRESHOLD) {
|
||||
dsyslog("buffer usage: %d%% (tid=%ld)", percent, getThreadTid);
|
||||
dsyslog("buffer usage: %d%% (tid=%d)", percent, getThreadTid);
|
||||
lastPercent = percent;
|
||||
}
|
||||
}
|
||||
@@ -286,7 +286,7 @@ uchar *cRingBufferLinear::Get(int &Count)
|
||||
uchar *p = NULL;
|
||||
int Head = head;
|
||||
if (getThreadTid <= 0)
|
||||
getThreadTid = pthread_self();
|
||||
getThreadTid = cThread::ThreadId();
|
||||
int rest = Size() - tail;
|
||||
if (rest < margin && Head < tail) {
|
||||
int t = margin - rest;
|
||||
|
||||
Reference in New Issue
Block a user