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
Johnny Cai
wine
Commits
bfaf0638
Commit
bfaf0638
authored
26 years ago
by
Francis Beaudet
Committed by
Alexandre Julliard
26 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Order of send message processing was not respected and the message
stacked last finished after the message stacked first.
parent
dae09c99
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
windows/message.c
+30
-1
30 additions, 1 deletion
windows/message.c
with
30 additions
and
1 deletion
windows/message.c
+
30
−
1
View file @
bfaf0638
...
...
@@ -686,8 +686,31 @@ static LRESULT MSG_SendMessage( HQUEUE16 hDestQueue, HWND hwnd, UINT msg,
}
}
/*
* Warning: This one looks like a hack but it has a very good reason
* for existing. It will become obsolete once an input task/thread is
* implemented
*
* Normally, once a send message operation is complete, you want to
* clear the wake bit QS_SMRESULT for this queue. However, because of
* the way the 16 bit threads are scheduled, the EVENT_WaitNetEvent
* method might be sending messages using the same message queue as the
* one used for this send message. Since the recipient of that other
* send message is in another thread, it is totally possible that a
* send message operation that occured in time before this one
* has completed it's work before this one does.
* If we clear the wake bit without checking and that operation has
* completed, the send message operation waiting in the call stack
* of the current thread will wait forever.
*/
EnterCriticalSection
(
&
queue
->
cSection
);
if
(
(
smsg
->
nextProcessing
==
0
)
||
((
smsg
->
nextProcessing
->
flags
&
SMSG_HAVE_RESULT
)
==
0
)
)
QUEUE_ClearWakeBit
(
queue
,
QS_SMRESULT
);
LeaveCriticalSection
(
&
queue
->
cSection
);
/* remove the smsg from the processingg list of the source queue */
QUEUE_RemoveSMSG
(
queue
,
SM_PROCESSING_LIST
,
smsg
);
...
...
@@ -773,7 +796,7 @@ BOOL WINAPI ReplyMessage( LRESULT result )
goto
ReplyMessageDone
;
smsg
->
lResult
=
result
;
smsg
->
flags
|=
SMSG_ALREADY_REPLIED
|
SMSG_HAVE_RESULT
;
smsg
->
flags
|=
SMSG_ALREADY_REPLIED
;
/* check if it's an early reply (called by the application) or
a regular reply (called by ReceiveMessage) */
...
...
@@ -788,9 +811,15 @@ BOOL WINAPI ReplyMessage( LRESULT result )
if
(
!
(
smsg
->
flags
&
SMSG_EARLY_REPLY
)
)
QUEUE_RemoveSMSG
(
queue
,
SM_WAITING_LIST
,
smsg
);
EnterCriticalSection
(
&
senderQ
->
cSection
);
smsg
->
flags
|=
SMSG_HAVE_RESULT
;
/* tell the sending task that its reply is ready */
QUEUE_SetWakeBit
(
senderQ
,
QS_SMRESULT
);
LeaveCriticalSection
(
&
senderQ
->
cSection
);
/* switch directly to sending task (16 bit thread only) */
if
(
THREAD_IsWin16
(
THREAD_Current
()
))
DirectedYield16
(
senderQ
->
thdb
->
teb
.
htask16
);
...
...
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