emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Incorrect declarations of thread functions on w32


From: Lennart Borgman
Subject: Re: Incorrect declarations of thread functions on w32
Date: Mon, 27 Nov 2006 14:20:48 +0100
User-agent: Thunderbird 1.5.0.8 (Windows/20061025)

Jason Rumney wrote:
Lennart Borgman wrote:
I thought I had given enough information when saying this. In the message before I told how the declaration should look according to MS. w32_msg_worker should have a declaration that looks like

DWORD WINAPI ThreadProc(
  LPVOID lpParameter
);

where ThreadProc should be replaced with w32_msg_worker. The same for reader_thread.
reader thread already has that signature.


Perhaps the declarations boils down to correct declarations under some circumstances , but I believe they should be changed since errors that bad declarations produce might be very hard to find. (Memory corruption etc.)

In the case of reader_thread, it is the correct declaration in all circumstances under Win32 (not under Win16, but Emacs does not target that platform)

Seems like reader_thread is ok, but would it not be much easier to understand if LPVOID was used instead of void* in the argument?

But w32_msg_worker needs some fix. I would suggest using exactly the type declarations from above. It makes it much easier to read the code if nothing else.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]