diff options
author | Steve Huston <shuston@riverace.com> | 2006-10-24 23:40:38 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 2006-10-24 23:40:38 +0000 |
commit | 79ffc8370729b8710e5052aa0b9c555ae358e812 (patch) | |
tree | 8dbc361f5a1314c62defba4508574a4fcc0c18e8 | |
parent | 167af9e4e836ae3681c70c22be991eb0c6561c3f (diff) | |
download | ATCD-79ffc8370729b8710e5052aa0b9c555ae358e812.tar.gz |
ChangeLogTag:Tue Oct 24 23:53:08 UTC 2006 Steve Huston <shuston@riverace.com>
-rw-r--r-- | ACE/ChangeLog | 12 | ||||
-rw-r--r-- | ACE/ace/config-aix-4.x.h | 4 | ||||
-rw-r--r-- | ACE/tests/Thread_Manager_Test.cpp | 47 |
3 files changed, 52 insertions, 11 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index d488ba2567b..dd767b13334 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,15 @@ +Tue Oct 24 23:53:08 UTC 2006 Steve Huston <shuston@riverace.com> + + * ace/config-aix-4.x.h: Changed ACE_HAS_PTHREAD_CONTINUE to + ACE_HAS_PTHREAD_CONTINUE_NP and ACE_HAS_PTHREAD_SUSPEND to + ACE_HAS_PTHREAD_SUSPEND_NP. The non-_NP varieties return ENOTSUP; + the _NP varieties are the only documented APIs through AIX 5.3. + Thanks to Guy Peleg for raising this issue. + + * tests/Thread_Manager_Test.cpp: Altered the suspend/resume tests to + only allow ENOTSUP as a legit result if the config.h file does not + include ACE_HAS_... settings that indicate it should work. + Tue Oct 24 23:59:10 UTC 2006 Ossama othman <ossama_othman at symantec dot com> * examples/Service_Configurator/IPC-tests/server/Handle_Timeout.inl diff --git a/ACE/ace/config-aix-4.x.h b/ACE/ace/config-aix-4.x.h index 8b6d031aadd..d434ad61003 100644 --- a/ACE/ace/config-aix-4.x.h +++ b/ACE/ace/config-aix-4.x.h @@ -314,8 +314,8 @@ # if (ACE_AIX_VERS >= 403) # define ACE_HAS_PTHREADS_STD # define ACE_HAS_PTHREADS_UNIX98_EXT -# define ACE_HAS_PTHREAD_CONTINUE -# define ACE_HAS_PTHREAD_SUSPEND +# define ACE_HAS_PTHREAD_CONTINUE_NP +# define ACE_HAS_PTHREAD_SUSPEND_NP # define ACE_HAS_RECURSIVE_MUTEXES # else # define ACE_HAS_PTHREADS_DRAFT7 diff --git a/ACE/tests/Thread_Manager_Test.cpp b/ACE/tests/Thread_Manager_Test.cpp index 2d9467b5124..01d8eb84d1d 100644 --- a/ACE/tests/Thread_Manager_Test.cpp +++ b/ACE/tests/Thread_Manager_Test.cpp @@ -341,11 +341,24 @@ run_main (int, ACE_TCHAR *[]) if (thr_mgr->suspend_grp (grp_id) == -1) { // Pthreads w/o UNIX 98 extensions doesn't support suspend/resume, - // so it's allowed to ENOTSUP; anything else is a hard fail. - ACE_ASSERT (errno == ENOTSUP); - ACE_DEBUG((LM_DEBUG, - ACE_TEXT (" OK: suspend_grp isn't supported with ") - ACE_TEXT ("Pthreads\n"))); + // so it's allowed to ENOTSUP as long as the config indicates this. + if (errno == ENOTSUP) + { +#if defined (ACE_HAS_PTHREADS) && (defined (ACE_HAS_PTHREAD_SUSPEND) || \ + defined (ACE_HAS_PTHREAD_SUSPEND_NP)) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("suspend_grp: ENOTSUP but config ") + ACE_TEXT ("says it should work.\n"))); +#else + ACE_DEBUG((LM_DEBUG, + ACE_TEXT (" OK: suspend_grp isn't supported with ") + ACE_TEXT ("Pthreads\n"))); +#endif /* ACE_HAS_PTHREADS && should be able to suspend */ + } + else + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("suspend_grp"))); + } } // Wait for 1 more second and then resume every thread in the @@ -357,10 +370,26 @@ run_main (int, ACE_TCHAR *[]) if (thr_mgr->resume_grp (grp_id) == -1) { - ACE_ASSERT (errno == ENOTSUP); - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT (" OK: resume_grp isn't supported with ") - ACE_TEXT ("Pthreads\n"))); + // Pthreads w/o UNIX 98 extensions doesn't support suspend/resume, + // so it's allowed to ENOTSUP as long as the config indicates this. + if (errno == ENOTSUP) + { +#if defined (ACE_HAS_PTHREADS) && (defined (ACE_HAS_PTHREAD_CONTINUE) || \ + defined (ACE_HAS_PTHREAD_CONTINUE_NP) || \ + defined (ACE_HAS_PTHREAD_RESUME_NP)) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("resume_grp: ENOTSUP but config ") + ACE_TEXT ("says it should work.\n"))); +#else + ACE_DEBUG((LM_DEBUG, + ACE_TEXT (" OK: resume_grp isn't supported with ") + ACE_TEXT ("Pthreads\n"))); +#endif /* ACE_HAS_PTHREADS && should be able to continue/resume */ + } + else + { + ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("resume_grp"))); + } } // Wait for 1 more second and then send a SIGINT to every thread in |