Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
21970dc2
Commit
21970dc2
authored
Dec 01, 2004
by
Ulrich Czekalla
Committed by
Alexandre Julliard
Dec 01, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent the animation thread from waiting on itself when it stops.
parent
0a258964
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
animate.c
dlls/comctl32/animate.c
+15
-10
No files found.
dlls/comctl32/animate.c
View file @
21970dc2
...
...
@@ -73,6 +73,7 @@ typedef struct
CRITICAL_SECTION
cs
;
HANDLE
hStopEvent
;
HANDLE
hThread
;
DWORD
threadId
;
UINT
uTimer
;
/* data for playing the file */
int
nFromFrame
;
...
...
@@ -149,14 +150,20 @@ static LRESULT ANIMATE_DoStop(ANIMATE_INFO *infoPtr)
HANDLE
handle
=
infoPtr
->
hThread
;
TRACE
(
"stopping animation thread
\n
"
);
infoPtr
->
hThread
=
0
;
SetEvent
(
infoPtr
->
hStopEvent
);
LeaveCriticalSection
(
&
infoPtr
->
cs
);
/* leave it a chance to run */
WaitForSingleObject
(
handle
,
INFINITE
);
TRACE
(
"animation thread stopped
\n
"
);
EnterCriticalSection
(
&
infoPtr
->
cs
);
CloseHandle
(
infoPtr
->
hThread
);
if
(
infoPtr
->
threadId
!=
GetCurrentThreadId
())
{
LeaveCriticalSection
(
&
infoPtr
->
cs
);
/* leave it a chance to run */
WaitForSingleObject
(
handle
,
INFINITE
);
TRACE
(
"animation thread stopped
\n
"
);
EnterCriticalSection
(
&
infoPtr
->
cs
);
}
CloseHandle
(
handle
);
CloseHandle
(
infoPtr
->
hStopEvent
);
infoPtr
->
h
Thread
=
0
;
infoPtr
->
h
StopEvent
=
0
;
}
if
(
infoPtr
->
uTimer
)
{
KillTimer
(
infoPtr
->
hwndSelf
,
infoPtr
->
uTimer
);
...
...
@@ -399,7 +406,7 @@ static DWORD CALLBACK ANIMATE_AnimationThread(LPVOID ptr_)
LeaveCriticalSection
(
&
infoPtr
->
cs
);
/* time is in microseconds, we should convert it to milliseconds */
if
(
WaitForSingleObject
(
event
,
(
timeout
+
500
)
/
1000
)
==
WAIT_OBJECT_0
)
if
(
(
event
==
0
)
||
WaitForSingleObject
(
event
,
(
timeout
+
500
)
/
1000
)
==
WAIT_OBJECT_0
)
break
;
}
return
TRUE
;
...
...
@@ -439,8 +446,6 @@ static LRESULT ANIMATE_Play(HWND hWnd, WPARAM wParam, LPARAM lParam)
/* create a timer to display AVI */
infoPtr
->
uTimer
=
SetTimer
(
hWnd
,
1
,
infoPtr
->
mah
.
dwMicroSecPerFrame
/
1000
,
NULL
);
}
else
{
DWORD
threadID
;
if
(
GetWindowLongA
(
hWnd
,
GWL_STYLE
)
&
ACS_TRANSPARENT
)
{
infoPtr
->
hbrushBG
=
(
HBRUSH
)
SendMessageA
(
infoPtr
->
hwndNotify
,
...
...
@@ -449,7 +454,7 @@ static LRESULT ANIMATE_Play(HWND hWnd, WPARAM wParam, LPARAM lParam)
TRACE
(
"Using an animation thread
\n
"
);
infoPtr
->
hStopEvent
=
CreateEventW
(
NULL
,
TRUE
,
FALSE
,
NULL
);
infoPtr
->
hThread
=
CreateThread
(
0
,
0
,
ANIMATE_AnimationThread
,(
LPVOID
)
infoPtr
,
0
,
&
threadID
);
infoPtr
->
hThread
=
CreateThread
(
0
,
0
,
ANIMATE_AnimationThread
,(
LPVOID
)
infoPtr
,
0
,
&
infoPtr
->
threadId
);
if
(
!
infoPtr
->
hThread
)
{
ERR
(
"Could not create animation thread!
\n
"
);
...
...
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