Go Back   ZeroC Forums > Bug Reports

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 02-25-2003
Ivan Ivan is offline
Registered User
 
 
Join Date: Feb 2003
Location: Helsinki, Finland
Posts: 15
Ice-1.0.1/C++/compilation

Hi,

"changes" say

- For posix threads, PTHREAD_MUTEX_RECURSIVE_NP is now only used if __linux__ is defined. Otherwise, PTHREAD_MUTEX_RECURSIVE is used.

But this code is commented in RecMutex.cpp, and there is another code which uses just PTHREAD_MUTEX_RECURSIVE and also pthread_mutexattr_settype which are undefined and compilation failed. Those are defined in pthread.h only if __USE_UNIX98 is defined.

What I did is I commented new code and uncommented what was commented. Went just fine.

So, why "#ifdef __linux__" code was commented?

Ivan
Reply With Quote
  #2 (permalink)  
Old 02-25-2003
Ivan Ivan is offline
Registered User
 
 
Join Date: Feb 2003
Location: Helsinki, Finland
Posts: 15
Forgot to mention the platform: Red Hat Linux release 7.2
Compiler: gcc 2.96
Reply With Quote
  #3 (permalink)  
Old 02-25-2003
marlowa marlowa is offline
Registered User
 
 
Join Date: Feb 2003
Location: London
Posts: 64
Re: Ice-1.0.1/C++/compilation

Quote:
Originally posted by Ivan
Hi,

"changes" say

- For posix threads, PTHREAD_MUTEX_RECURSIVE_NP is now only used if __linux__ is defined. Otherwise, PTHREAD_MUTEX_RECURSIVE is used.

But this code is commented in RecMutex.cpp, and there is another code which uses just PTHREAD_MUTEX_RECURSIVE and also pthread_mutexattr_settype which are undefined and compilation failed. Those are defined in pthread.h only if __USE_UNIX98 is defined.
Ivan
The problem is that the original code failed to compile on Solaris using Forte because Ice was setting the mutex attribute in a non-std way. However the std way is only std as of POSIX 1.c. I submitted a fix but my fix was bad because I did not check properly that the environment conforms to POSIX 1.c (so blame me!). The std way to do this check is to compare _POSIX_VERSION with 199506L. This means that when/if Linux conforms to POSIX 1.c then Linux will also use pthread_mutexattr_settype. Can Ice developers make this change for Ice v1.0.2 please?

Regards,

Andrew M.
__________________
You are in a maze of twisty little passages, all different.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compilation Problem with GCC mykael Help Center 1 07-03-2006 04:06 AM
problem with c++ compilation arnaud Help Center 4 04-21-2006 08:18 PM
ICE 3.0.0. VC7.1 compilation error AnandRathi Bug Reports 3 11-28-2005 12:32 AM
Compilation problem under Win XP mthiercy Help Center 4 05-28-2003 07:58 AM
Compilation error Diego Giraldez Help Center 4 04-29-2003 04:23 PM


All times are GMT -4. The time now is 07:52 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.