pthread's mutex question

Pattara Kiatisevi pkiatisevi at student.ei.uni-stuttgart.de
Mon Apr 29 16:04:09 UTC 2002


Hi again,

I have played with pthread's mutex with this small code:

  pthread_mutex_t a,b;

  printf("Initialize mutexes...\n");
  pthread_mutex_init(&a, NULL);
  pthread_mutex_init(&b, NULL);

  printf("Trying to lock mutex a..\n");
  pthread_mutex_lock(&a);
  printf("Got mutex a..\n");

  printf("Trying to lock mutex a..\n");
  pthread_mutex_lock(&a);	<----------should block here
  printf("Got mutex a..\n");



  fprintf(stderr,"Done.\n");


On Linux, the program will block forever at the second attempt to lock
mutex a but on RTEMS it doesn't block. Instead it returns with value 45.
Is there any chance to have it blocked here in RTEMS?

Regards,
Pattara


--
Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
----------------------------------------------------------------------
Ott Pattara Kiatisevi 				   T L W G
M.Sc. INFOTECH Student, Stuttgart, Germany	http://linux.thai.net/
----------------------------------------------------------------------




More information about the users mailing list