| www.delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| From: | "Christoph" <chr_news AT gmx DOT net> |
| To: | <tpfaff AT gmx DOT net> |
| Cc: | <cygwin AT cygwin DOT com> |
| Subject: | Re: [PATCH] Modified pthread types; From: cygwin-patches AT cygwin DOT com |
| Date: | Sun, 7 Jul 2002 14:20:10 +0200 |
| Message-ID: | <000601c225b0$a68ceac0$0100a8c0@lony> |
| MIME-Version: | 1.0 |
| X-Priority: | 3 (Normal) |
| X-MSMail-Priority: | Normal |
| In-Reply-To: | <20020707042558.GA23101@redhat.com> |
| X-MimeOLE: | Produced By Microsoft MimeOLE V6.00.2600.0000 |
| Importance: | Normal |
> From: Thomas Pfaff
> To: cygwin-patches.cygwin.com
http://cygwin.com/ml/cygwin-patches/2002-q3/msg00052.html
>
> I have attached a patch with modified (dummy) pthread typedefs.
>
> This should give the compiler a chance to do some type validations,
> for example:
>
> pthread_t t;
> pthread_create(t,...) //wrong
> pthread_create(&t,...) // right
>
> pthread_cancel(t) //right
> pthread_cancel(&t)//wrong
Using your patch I needed to tweak /usr/include/pthreads.h
when compiling libstdc++. Also I don't think that I saw a
memory leak when running your test program from the
cygwin-patch mailing list.
http://cygwin.com/ml/cygwin-patches/2002-q2/msg00214.html
Note I linked the CYGWIN dll to the gcc libraries generated
by a pthreads + exception enabled compile.
/Christoph
--- /usr/include/pthread.h.old 2002-07-04 17:01:18.000000000 +0200
+++ /usr/include/pthread.h 2002-07-05 20:48:12.000000000 +0200
@@ -44,7 +44,7 @@
#define PTHREAD_CANCEL_DISABLE 1
#define PTHREAD_CANCELED ((void *)-1)
/* this should be a value that can never be a valid address */
-#define PTHREAD_COND_INITIALIZER (void *)21
+#define PTHREAD_COND_INITIALIZER (pthread_mutex_t)21
#define PTHREAD_CREATE_DETACHED 1
/* the default : joinable */
#define PTHREAD_CREATE_JOINABLE 0
@@ -54,7 +54,7 @@
#define PTHREAD_MUTEX_ERRORCHECK 1
#define PTHREAD_MUTEX_NORMAL 2
/* this should be too low to ever be a valid address */
-#define PTHREAD_MUTEX_INITIALIZER (void *)20
+#define PTHREAD_MUTEX_INITIALIZER (pthread_mutex_t)20
#define PTHREAD_MUTEX_RECURSIVE 0
#define PTHREAD_ONCE_INIT { PTHREAD_MUTEX_INITIALIZER, 0 }
#define PTHREAD_PRIO_INHERIT
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |