This is the mail archive of the
cygwin-developers@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: (patch) enable signals in dynamically loaded Cygwin DLL
- To: Mumit Khan <khan at nanotech dot wisc dot edu>
- Subject: Re: (patch) enable signals in dynamically loaded Cygwin DLL
- From: Chris Faylor <cgf at cygnus dot com>
- Date: Mon, 6 Dec 1999 23:48:15 -0500
- Cc: cygwin-developers at sourceware dot cygnus dot com
- References: <199912070351.VAA26863@mercury.xraylith.wisc.edu>
On Mon, Dec 06, 1999 at 09:51:31PM -0600, Mumit Khan wrote:
>Completely forgot about the synchronization used in makethread to avoid
>stack corruption, and that's why enabling signals for dynamically loaded
>Cygwin was crashing in newly created threads.
>
>This change removes the synchronization and uses dynamically allocated
>memory to the thread stub routine, which frees the memory. The overhead
>should be roughly the same, perhaps a tiny bit higher due to malloc's
>internal MT synchronization.
>
>A gotcha for future users of makethread -- if you pass a thread parameter,
>make sure it's not on the stack (which is the case currently, so it should
>be safe).
Note that this probably affects tty initialization too. It's not just
signals that are affected, it's any thread that is started during DLL
initialization. Since CYGWIN=tty implies the creation of several runtime
threads, I assume that the problem is manifested there as well.
cgf