Tuesday, November 21st 2017, 7:18am UTC+1

You are not logged in.

  • Login
  • Register

Gabri74

Beginner

Date of registration: Mar 23rd 2016

Posts: 2

1

Wednesday, March 23rd 2016, 12:25pm

[SOLVED] Are WM_MESSAGEs sent witch WM_BroadcastMessage() serialized ?

As title says, are WM_MESSAGEs sent with WM_BroadcastMessage() serialized and queued somewhere until consumed or the WM_MESSAGE
structure passed to WM_BroadcastMessage() must be valid till the message is consumed?
For example, is the following code legit:

Source code

1
2
3
4
5
6
7
8
9
void SendSignal(const int id, const int v, void *p)
{
	WM_MESSAGE msg;

	msg.MsgId = id;
	msg.Data.p = p;
	msg.Data.v = v;
	WM_BroadcastMessage(&msg);
}


or should WM_MESSAGE be declared static ?
This would imply I can send only one message at a time and wait until the message is consumed
before sending another one (or else I must manage myself a message queue).
This behavior is not documented anywhere as far as i can tell.

Best regards, Gabriele.

This post has been edited 1 times, last edit by "Gabri74" (Mar 31st 2016, 11:28am)


SEGGER - Jörg

Super Moderator

Date of registration: Dec 20th 2007

Posts: 81

2

Tuesday, March 29th 2016, 3:48pm

Hi,

Your function is legit. WM_BroadcastMessage() sends its own copy of the given message.

Regards,
Jörg

Gabri74

Beginner

Date of registration: Mar 23rd 2016

Posts: 2

3

Thursday, March 31st 2016, 11:28am

Thanks a lot :thumbsup: