Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jonathan Wilkes
flext
Commits
51fdf0ac
Commit
51fdf0ac
authored
Aug 01, 2002
by
thomas
Browse files
no message
git-svn-id:
https://svn.grrrr.org/ext/trunk@194
4d9ac71a-51e6-0310-8455-cad1006bcd31
parent
59d0341c
Changes
3
Hide whitespace changes
Inline
Side-by-side
flext.dsp
View file @
51fdf0ac
...
...
@@ -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_D
ebug"
# PROP Intermediate_Dir "
flext___Win32_Threads_D
ebug"
# PROP Output_Dir "
msvc-t-d
ebug"
# PROP Intermediate_Dir "
msvc-t-d
ebug"
# 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
...
...
source/flclass.h
View file @
51fdf0ac
...
...
@@ -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
{
...
...
source/flthr.cpp
View file @
51fdf0ac
...
...
@@ -93,29 +93,47 @@ void flext_base::YTick(flext_base *th) {
#endif
int
flext_base
::
Get
Priority
()
void
flext_base
::
Normal
Priority
()
{
#ifdef NT
HANDLE
thr
=
GetCurrentThread
();
return
G
etThreadPriority
(
thr
);
S
etThreadPriority
(
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
());
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment