diff options
author | Steve Huston <shuston@riverace.com> | 2006-03-14 23:39:53 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 2006-03-14 23:39:53 +0000 |
commit | 540d9e294cf895d4a77750aa7c59ed2e15fd3b6b (patch) | |
tree | 34bcdd6c0dd01c326c864f293c46fdb82618ef6e | |
parent | 46d4bda1a0b8da523cf8a0e3aa10046ea0de89e2 (diff) | |
download | ATCD-540d9e294cf895d4a77750aa7c59ed2e15fd3b6b.tar.gz |
ChangeLogTag:Tue Mar 14 23:33:27 UTC 2006 Steve Huston <shuston@riverace.com>
-rw-r--r-- | ChangeLog | 24 | ||||
-rw-r--r-- | THANKS | 1 | ||||
-rw-r--r-- | ace/OS_NS_Thread.inl | 19 |
3 files changed, 36 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog index afdf427085e..e5eb1c0a664 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Tue Mar 14 23:33:27 UTC 2006 Steve Huston <shuston@riverace.com> + + * ace/OS_NS_Thread.inl (recursive_mutex_cond_unlock): Fix this for + WinCE. CE doesn't have a RecursionCount, and LockCount is not an + indicator of recursion on WinCE; instead, see when it's unlocked + by watching the OwnerThread, which will change to something other + than the current thread when it's been unlocked "enough" times. + Thanks to Spencer Vanroekel <Spencer dot Vanroekel at Siemens dot + com> for the investigations leading to this solution. + Tue Mar 14 20:58:12 UTC 2006 jiang,shanshan <shanshan.jiang@vanderbilt.edu> * ace/WIN32_Asynch_IO.cpp @@ -40,13 +50,13 @@ Tue Mar 14 20:58:12 UTC 2006 jiang,shanshan <shanshan.jiang@vanderbilt.edu> * apps/gperf/src/List_Node.cpp * apps/gperf/src/Options.cpp * protocols/ace/HTBP/HTBP_ID_Requestor.cpp - Updated these files to solve the warnings when setting up "VC level 4 warnings" - on Windows. These warnings include "unreachable code", "assignment within - conditional expression", "conversion from some type to another type, possible - loss of data", "local variable may be used without having been initialized" and - so on. - Thanks to Lukas Gruetzmacher <gruetzmacher at ais-dresden dot de> for - motivating the fix to these "VC level 4 warnings". + Updated these files to solve the warnings when setting up "VC level + 4 warnings" on Windows. These warnings include "unreachable code", + "assignment within conditional expression", "conversion from some + type to another type, possible loss of data", "local variable may be + used without having been initialized" and so on. + Thanks to Lukas Gruetzmacher <gruetzmacher at ais-dresden dot de> + for motivating the fix to these "VC level 4 warnings". Tue Mar 14 15:55:08 UTC 2006 Olli Savia <ops@iki.fi> @@ -2079,6 +2079,7 @@ Frank Rehberger <frehberger at prismtech dot com> Aaron Scamehorn <aaron dot scamehorn at cogcap dot com> Alan Kierstead <ackierstead at fedex dot com> Sven-Uwe Sieler-Hornke <sven-uwe dot sieler-hornke at investment-cybernetics dot de> +Spencer Vanroekel <Spencer dot Vanroekel at Siemens dot com> I would particularly like to thank Paul Stephenson, who worked with me at Ericsson in the early 1990's. Paul devised the recursive Makefile diff --git a/ace/OS_NS_Thread.inl b/ace/OS_NS_Thread.inl index 135809318c7..ef188f3a514 100644 --- a/ace/OS_NS_Thread.inl +++ b/ace/OS_NS_Thread.inl @@ -597,9 +597,26 @@ ACE_OS::recursive_mutex_cond_unlock (ACE_recursive_thread_mutex_t *m, // need to release the lock one fewer times than this thread has acquired // it. Remember how many times, and reacquire it that many more times when // the condition is signaled. + // + // For WinCE, the situation is a bit trickier. CE doesn't have + // RecursionCount, and LockCount is not an indicator of recursion on WinCE; + // instead, see when it's unlocked by watching the OwnerThread, which will + // change to something other than the current thread when it's been + // unlocked "enough" times. Note that checking for 0 (unlocked) is not + // sufficient. Another thread may acquire the lock between our unlock and + // checking the OwnerThread. So grab our thread ID value first, then + // compare to it in the loop condition. +# if defined (ACE_HAS_WINCE) + ACE_thread_t me = ACE_OS::thr_self (); +# endif /* ACE_HAS_WINCE */ + state.relock_count_ = 0; while (m->LockCount > 0 -# if !defined (ACE_HAS_WINCE) /* WinCE doesn't have RecursionCount */ +# if defined (ACE_HAS_WINCE) + // Although this is a thread ID, OwnerThread's type is HANDLE. + // Not sure if this is a problem, but it appears to work. + && m->OwnerThread == (HANDLE)me +# else && m->RecursionCount > 1 # endif ) |