Commit 51fdf0ac authored by thomas's avatar thomas
Browse files

no message


git-svn-id: https://svn.grrrr.org/ext/trunk@194 4d9ac71a-51e6-0310-8455-cad1006bcd31
parent 59d0341c
......@@ -85,8 +85,8 @@ LIB32=link.exe -lib
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "flext___Win32_Threads_Debug"
# PROP Intermediate_Dir "flext___Win32_Threads_Debug"
# PROP Output_Dir "msvc-t-debug"
# PROP Intermediate_Dir "msvc-t-debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GR /ZI /Od /I "c:\programme\audio\pd\src" /I "." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "PD" /D "NT" /D "FLEXT_THREADS" /FR /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GR /ZI /Od /I "c:\programme\audio\pd\src" /I "." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "PD" /D "NT" /D "FLEXT_THREADS" /FR /YX /FD /GZ /c
......@@ -97,7 +97,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"msvc-debug\flext-pdwin.lib"
# ADD LIB32 /nologo /out:"msvc-debug\flext_t-pdwin.lib"
# ADD LIB32 /nologo /out:"msvc-t-debug\flext_t-pdwin.lib"
!ELSEIF "$(CFG)" == "flext - Win32 Threads Release"
......@@ -108,8 +108,8 @@ LIB32=link.exe -lib
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "flext___Win32_Threads_Release"
# PROP Intermediate_Dir "flext___Win32_Threads_Release"
# PROP Output_Dir "msvc-t"
# PROP Intermediate_Dir "msvc-t"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GR /O2 /I "c:\programme\audio\pd\src" /I "." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "PD" /D "NT" /D "FLEXT_THREADS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GR /O2 /I "c:\programme\audio\pd\src" /I "." /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "PD" /D "NT" /D "FLEXT_THREADS" /YX /FD /c
......@@ -120,7 +120,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"msvc/flext-pdwin.lib"
# ADD LIB32 /nologo /out:"msvc/flext_t-pdwin.lib"
# ADD LIB32 /nologo /out:"msvc-t/flext_t-pdwin.lib"
!ENDIF
......
......@@ -367,10 +367,9 @@ public:
;
#endif
int GetPriority();
void SetPriority(int p);
void RaisePriority() { SetPriority(GetPriority()+1); }
void LowerPriority() { SetPriority(GetPriority()-1); }
void NormalPriority();
void LowerPriority();
void LowestPriority();
class ThrMutex
{
......
......@@ -93,29 +93,47 @@ void flext_base::YTick(flext_base *th) {
#endif
int flext_base::GetPriority()
void flext_base::NormalPriority()
{
#ifdef NT
HANDLE thr = GetCurrentThread();
return GetThreadPriority(thr);
SetThreadPriority(thr,THREAD_PRIORITY_NORMAL);
#else
int policy;
int policy = 0;
sched_param parm;
pthread_getschedparam(pthread_self(),&policy,&parm);
parm.sched_priority = 0;
if(pthread_setschedparam(pthread_self(),policy,&parm)) {
post("%s - failed to change priority",thisName());
}
#endif
}
return parm.sched_priority;
void flext_base::LowerPriority()
{
#ifdef NT
HANDLE thr = GetCurrentThread();
SetThreadPriority(thr,THREAD_PRIORITY_BELOW_NORMAL);
#else
int policy = 0;
sched_param parm;
parm.sched_priority = -1;
if(pthread_setschedparam(pthread_self(),policy,&parm)) {
post("%s - failed to change priority",thisName());
}
#endif
}
void flext_base::SetPriority(int p)
void flext_base::LowestPriority()
{
#ifdef NT
HANDLE thr = GetCurrentThread();
SetThreadPriority(thr,p);
SetThreadPriority(thr,THREAD_PRIORITY_LOWEST);
#else
int policy = 0;
sched_param parm;
parm.sched_priority = 0;
parm.sched_priority = -2;
if(pthread_setschedparam(pthread_self(),policy,&parm)) {
post("%s - failed to change priority",thisName());
}
......
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