Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jason Beetham
wine
Commits
06bcab8a
Commit
06bcab8a
authored
25 years ago
by
Ulrich Weigand
Committed by
Alexandre Julliard
25 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Use services thread instead of timer signals.
parent
f6461fe2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
misc/system.c
+16
-46
16 additions, 46 deletions
misc/system.c
with
16 additions
and
46 deletions
misc/system.c
+
16
−
46
View file @
06bcab8a
...
...
@@ -4,19 +4,9 @@
* Copyright 1996 Alexandre Julliard
*/
#include
<stdlib.h>
#include
<signal.h>
#include
<time.h>
#include
<sys/time.h>
#include
<sys/timeb.h>
#include
<sys/types.h>
#include
<sys/wait.h>
#include
"wine/winbase16.h"
#include
"wine/winuser16.h"
#include
"selectors.h"
#include
"sig_context.h"
#include
"miscemu.h"
#include
"services.h"
#include
"debug.h"
typedef
struct
...
...
@@ -31,16 +21,15 @@ typedef struct
static
SYSTEM_TIMER
SYS_Timers
[
NB_SYS_TIMERS
];
static
int
SYS_NbTimers
=
0
;
static
BOOL
SYS_TimersDisabled
=
FALS
E
;
static
HANDLE
SYS_Service
=
INVALID_HANDLE_VALU
E
;
/***********************************************************************
* SYSTEM_TimerTick
*/
static
HANDLER_DEF
(
SYSTEM_TimerTick
)
static
void
CALLBACK
SYSTEM_TimerTick
(
ULONG_PTR
arg
)
{
int
i
;
HANDLER_INIT
();
for
(
i
=
0
;
i
<
NB_SYS_TIMERS
;
i
++
)
{
...
...
@@ -60,23 +49,8 @@ static HANDLER_DEF(SYSTEM_TimerTick)
*/
static
void
SYSTEM_StartTicks
(
void
)
{
static
BOOL
handler_installed
=
FALSE
;
if
(
!
handler_installed
)
{
handler_installed
=
TRUE
;
SIGNAL_SetHandler
(
SIGALRM
,
SYSTEM_TimerTick
,
1
);
}
#ifndef __EMX__
/* FIXME: Time don't work... Use BIOS directly instead */
{
struct
itimerval
vt_timer
;
vt_timer
.
it_interval
.
tv_sec
=
0
;
vt_timer
.
it_interval
.
tv_usec
=
54929
;
vt_timer
.
it_value
=
vt_timer
.
it_interval
;
setitimer
(
ITIMER_REAL
,
&
vt_timer
,
NULL
);
}
#endif
if
(
SYS_Service
==
INVALID_HANDLE_VALUE
)
SYS_Service
=
SERVICE_AddTimer
(
SYS_TIMER_RATE
,
SYSTEM_TimerTick
,
0L
);
}
...
...
@@ -87,14 +61,11 @@ static void SYSTEM_StartTicks(void)
*/
static
void
SYSTEM_StopTicks
(
void
)
{
#ifndef __EMX__
/* FIXME: Time don't work... Use BIOS directly instead */
struct
itimerval
vt_timer
;
vt_timer
.
it_interval
.
tv_sec
=
0
;
vt_timer
.
it_interval
.
tv_usec
=
0
;
vt_timer
.
it_value
=
vt_timer
.
it_interval
;
setitimer
(
ITIMER_REAL
,
&
vt_timer
,
NULL
);
#endif
if
(
SYS_Service
!=
INVALID_HANDLE_VALUE
)
{
SERVICE_Delete
(
SYS_Service
);
SYS_Service
=
INVALID_HANDLE_VALUE
;
}
}
...
...
@@ -140,8 +111,7 @@ WORD WINAPI CreateSystemTimer( WORD rate, SYSTEMTIMERPROC callback )
SYS_Timers
[
i
].
rate
=
SYS_TIMER_RATE
;
SYS_Timers
[
i
].
ticks
=
SYS_Timers
[
i
].
rate
;
SYS_Timers
[
i
].
callback
=
callback
;
if
((
++
SYS_NbTimers
==
1
)
&&
!
SYS_TimersDisabled
)
SYSTEM_StartTicks
();
if
(
++
SYS_NbTimers
==
1
)
SYSTEM_StartTicks
();
return
i
+
1
;
/* 0 means error */
}
return
0
;
...
...
@@ -157,7 +127,7 @@ WORD WINAPI SYSTEM_KillSystemTimer( WORD timer )
{
if
(
!
timer
||
(
timer
>
NB_SYS_TIMERS
))
return
timer
;
/* Error */
SYS_Timers
[
timer
-
1
].
callback
=
NULL
;
if
(
(
!--
SYS_NbTimers
)
&&
!
SYS_TimersDisabled
)
SYSTEM_StopTicks
();
if
(
!--
SYS_NbTimers
)
SYSTEM_StopTicks
();
return
0
;
}
...
...
@@ -167,8 +137,8 @@ WORD WINAPI SYSTEM_KillSystemTimer( WORD timer )
*/
void
WINAPI
EnableSystemTimers16
(
void
)
{
SYS_TimersDisabled
=
FALSE
;
if
(
SYS_NbTimers
)
SYSTEM_StartTicks
(
);
if
(
SYS_Service
!=
INVALID_HANDLE_VALUE
)
SERVICE_Enable
(
SYS_Service
);
}
...
...
@@ -177,6 +147,6 @@ void WINAPI EnableSystemTimers16(void)
*/
void
WINAPI
DisableSystemTimers16
(
void
)
{
SYS_TimersDisabled
=
TRUE
;
if
(
SYS_NbTimers
)
SYSTEM_StopTicks
(
);
if
(
SYS_Service
!=
INVALID_HANDLE_VALUE
)
SERVICE_Disable
(
SYS_Service
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment