Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Thu, 21 Jun 2001 10:55:20 -0700 (PDT) Message-Id: <20010621.105520.60852578.Takaaki.Ota@am.sony.com> To: cygwin AT cygwin DOT com Subject: pthread From: Tak Ota X-Mailer: Mew version 1.95b126 on Emacs 21.0.103.1 / Mule 5.0 (SAKAKI) X-Telephone: +1-858-942-3239 X-Fax------: +1-858-942-9142 X-SnailMail: 16450 West Bernardo Drive MZ7205, San Diego, CA 92127-1804 Organization: Sony Electronics Inc. Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello all, I just subscribed to the list yesterday. So excuse me if the following has already been discussed before. I'm trying to exercise pthread on cyginw. Following is the code I am trying to run. It compiles fine but when it runs I am expecting to see "Hello World" output but actually see nothing printed. The same code was tested under Linux and it ran as expected. Could anyone tell me what I am doing wrong here? Thanks in advance. -Tak ------------------------------------------------------------------ #include #include void print_message_function( void *ptr ) { char *message; message = (char *) ptr; fprintf(stderr, "%s ", message); } int main(int argc, char **argv) { pthread_t thread1 = 0, thread2 = 0; char *message1 = "Hello"; char *message2 = "World"; pthread_create(&thread1, NULL, (void*)&print_message_function, (void*) message1); pthread_create(&thread2, NULL, (void*)&print_message_function, (void*) message2); return 0; } -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple