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
59d0341c
Commit
59d0341c
authored
Aug 01, 2002
by
thomas
Browse files
no message
git-svn-id:
https://svn.grrrr.org/ext/trunk@193
4d9ac71a-51e6-0310-8455-cad1006bcd31
parent
25379407
Changes
2
Hide whitespace changes
Inline
Side-by-side
source/flclass.h
View file @
59d0341c
...
...
@@ -367,6 +367,11 @@ public:
;
#endif
int
GetPriority
();
void
SetPriority
(
int
p
);
void
RaisePriority
()
{
SetPriority
(
GetPriority
()
+
1
);
}
void
LowerPriority
()
{
SetPriority
(
GetPriority
()
-
1
);
}
class
ThrMutex
{
public:
...
...
source/flthr.cpp
View file @
59d0341c
...
...
@@ -18,6 +18,10 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#include <sched.h>
#endif
#ifdef NT
#include <windows.h>
#endif
bool
flext_base
::
StartThread
(
void
*
(
*
meth
)(
thr_params
*
p
),
thr_params
*
p
,
char
*
methname
)
{
#ifdef _DEBUG
...
...
@@ -88,6 +92,37 @@ void flext_base::YTick(flext_base *th) {
}
#endif
int
flext_base
::
GetPriority
()
{
#ifdef NT
HANDLE
thr
=
GetCurrentThread
();
return
GetThreadPriority
(
thr
);
#else
int
policy
;
sched_param
parm
;
pthread_getschedparam
(
pthread_self
(),
&
policy
,
&
parm
);
return
parm
.
sched_priority
;
#endif
}
void
flext_base
::
SetPriority
(
int
p
)
{
#ifdef NT
HANDLE
thr
=
GetCurrentThread
();
SetThreadPriority
(
thr
,
p
);
#else
int
policy
=
0
;
sched_param
parm
;
parm
.
sched_priority
=
0
;
if
(
pthread_setschedparam
(
pthread_self
(),
policy
,
&
parm
))
{
post
(
"%s - failed to change priority"
,
thisName
());
}
#endif
}
class
flext_base
::
qmsg
{
public:
...
...
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